Hydra 4 bridges the gap between the worlds of unmanaged Delphi code and the Microsoft .NET and Silverlight platforms by letting developers integrate the 2.5 platforms seamlessly within the same application – whether by reusing Delphi code in new .NET applications or extending exiting Delphi VCL apps with new parts created in .NET, Silverlight or FireMonkey
Combining Delphi and .NET
These days, many Delphi developers consider migrating to the .NET platform, either to make use of its advanced development capabilities and better languages or to leverage new technologies such as the Windows Presentation Foundation or LINQ. At the same time, they are rightfully hesitant to leave the existing investment in their extensive Delphi code base behind.
Hydra 4 – provided in one SKU for both Delphi and .NET – enables you to keep your investment in your existing native Delphi code base, while at the same time opening your applications to managed plugins. This allows new development to happen in .NET, for example using C#, Oxygene, Visual Basic.NET or any other languages available for .NET.
At the same time, the existing code can be kept and maintained in Delphi, and both parts can contribute to what appears to the end user as a single, unified application.
This makes it possible to employ new and emerging .NET technologies within your existing Delphi-based application frame. For example, you might decide to implement fancy diagrams using the hardware-accelerated Windows Presentation Foundation (WPF) introduced in .NET 3.0 (as in the example shown on the left) or XE2's new FireMonkey. Or maybe you want to leverage technologies such as LINQ in your non-visual data processing code and show the results in your Delphi app.
Hydra is also helpful for migrating applications to .NET altogether, in a step-by-step fashion. Developers can start by modularizing their existing Win32 code base and extend it with .NET code or port selective modules over to .NET, where it makes most sense (for example those modules that still see most active development and would benefit most from using new, .NET-based development technologies).
Over time, they can elect to port and replace the remaining modules (and even the host application) over time and at their own pace. They can keep working on the project in mixed-mode, or eventually migrate to a fully managed solution, once all parts are ported.
Read more about building Mixed-Mode applications with Hydra, here.
Combining VCL and FireMonkey
With Delphi XE2, Embarcadero introduced FireMonkey, a new framework for building rich 3D and vector-based graphical user interfaces using unmanaged Delphi code – comparable to what WPF offers on the .NET side. Unfortunately, the VCL and FireMonkey don't mix well, so once again developers are asked to leave their existing investment in VCL application code behind to adopt the new technology.
Hydra 4 provides a solution for this problem by allowing developers tointegrate FireMonkey UI seamlessly with their existing VCL applications, or conversely add existing VCL user interfaces into new FireMonkey apps. FireMonkey code can even be used with VCL code compiled in different versions of Delphi – so they can for example extend a Delphi 7 VCL application with new FireMonkey functionality, without porting the entire project to XE2.
And of course this works together with .NET and Silverlight plugins as well, letting you combine all of VCL, FireMonkey, WinForms, WPF and Silverlight in the same application, if necessary.
Plugins and host created using different development platforms can communicate seamlessly using custom interfaces you can define, and Hydra's IDE integration in Delphi and Visual Studio lets you seamlessly port these interface definitions between the two platforms.
You can define your custom interfaces in Delphi code, and let Hydra's toolchain parse the code to generate the necessary interface definitions in C#, VB, Oxygene or any other .NET language. Or you can define your interfaces in .NET and let Hydra import them into your Delphi project.
Host and plugins can communicate using these interfaces without needing to be aware of the platform differences.
Hydra 4 Host Platforms
Hydra applications consist of both plugins and hosts, both of which can be implemented using a variety of different development tools and UI frameworks that can be combined seamlessly. This page takes a look at the three different host platforms supported by Hydra 4; each type of host can use all the supported plugin platforms.
Delphi's Visual Component Library (VCL)
Probably the most common use case for Hydra today is a host application written in Delphi using the VCL and hosting plugins created either with the VCL as well, or using any of the other plugin platforms we support. Common reasons and scenarios for creating this type of applications include:
The desire to build a dynamic application that can be expanded with new functionality simply by adding additional plugins that conform to the same well-defined API (with or without taking advantage of the different plugin platforms).
The need to extend an existing Delphi VCL application with elements that are more easy or convenient to implement using other platforms, for example to leverage the rich UI capabilities of WPF, Silverlight or FireMonkey, or the technical benefits of .NET languages, when writing new code.
The ability to start a piecemeal port of a legacy Delphi application to .NET by first modularizing it, and then porting individual plugins to .NET, optionally concluded by a port of the host application itself.
»» VCL hosts can be created with Delphi 7 and later. Starting with Delphi XE2, hosts can support Win64 in addition to Win32.
.NET's Windows Forms
Just as with the VCL for Delphi, WinForms is, to date, the prevalent framework for creating applications using the standard Windows user interface controls on the .NET platform. Reasons for turning your WinForms application into a Hydra host include:
Wanting to expand a WinForms app with user interface elements that are more easy or convenient to implement using WPF or FireMonkey, for example to add visually rich and stunning graphics for data visualization or other purposes.
Needing to reuse legacy business logic or forms implemented in Delphi, without the need to port over to a .NET-based language.
Providing a modular application that can be expanded dynamically with new functionality by adding additional plugins (whether purely based on WinForms or leveraging any of the other plugin platforms).
Having concluded a piecemeal port of a legacy Delphi application to the .NET platform by concerting the host application.
»» WinForms hosts can be created in Visual Studio using C#, Oxygene for .NET and Visual Basic.NET, as well as any other CLR-compliant language available for the .NET Framework.
FireMonkey is the new framework from Embarcadero in Delphi XE2 and later for creating rich vector-based user interfaces and 3D graphics, similar to .NET's Windows Presentation Foundation, using Win32 or Win64 Delphi code.
Reuse existing business logic or forms that use the VCL in your new FireMonkey application, which Delphi does not support out of the box.*
Create an extensible application that can load new functionality at runtime from plugins conforming to a common set of APIs defined by your app (whether they are all based on FireMonkey, or leverage other technologies as well).
Extend a FireMonkey application with elements that are more easy or convenient to implement using the .NET or Silverligght platforms, for example to leverage the technical benefits and advanced features of .NET languages such as Oxygene over unmanaged Delphi code.