One of the projects I’ve worked on, off-and-on, for around four years, is a light-weight application framework based on the plugin framework Hydra from RemObjects and the visual controls from DevExpress (not to be confused with DevExpress’s own XAF, which blows this out of the water – maybe the term plugin framework is more fitting?).
I wouldn’t be surprised if many software developers, at some point, come to realize that a lot of the common elements between their projects could be abstracted to such a point that various products could be built on the same application framework (be it desktop software or a web application). I came to this point around five years ago, and have written at least two or tree starting-points for the project over time.
The initial project was written in Delphi, using Hydra and DevExpress’s VCL controls. The current version of this project is written in C# using Visual Studio 2008, and uses Hydra and DevExpress’s WinForms controls.
The goals for this project have evolved over the years, but are still pretty much the same as they are when it started:
- The framework should make it very easy to expose the features of the DevExpress controls – runtime grid customization, runtime layout customization, theme and skin changes – you name it
- The framework should be very loose, allowing pretty much any type of application to be built (adhering to a few UI guidelines and paradigms)
- The framework should still allow for a high degree of integration between the plugins themselves and between the plugins and host
- The plugins and host should be capable of being designed using the native designers (eg. using the DevExpress designers to design toolbars, ribbons, etc. rather than some other “description” that gets passed to the host and merged into the UI)
- The framework should be very light – as little code and as well written as possible to get things done
This latest iteration of the project, which started a little under year ago, has been coming along well. I’ve worked on it lightly here-and-there (it’s just a hobby project really), but I’ve been happy with the results. The DevExpress WinForms controls and Hydra (along with C# and the .NET framework) have made it surprisingly easy to achieve my goals.
Currently I have a host executable and a couple of assemblies. The host doesn’t really do much of anything except display a form. Using Hydra visual and non-visual plugins, the host can be expanded with plugins for branding (company name, application name, etc.), plugins for displaying individual pages of options within the host’s settings dialog, plugins for displaying browse screens and details screens, generic dockable windows, and more.
It’s all pretty loosely coupled as I mentioned, and gives full support for (so far):
- The Ribbon control from DevExpress – design Ribbon control in the plugins and have them merged automatically into a single ribbon at runtime in the host
- The NavBar control from DevExpress – as with the Ribbon, design the NavBar controls and groups within the plugins at design-time and they are merged automatically into the host’s NavBar at runtime
- The DX Ribbon StatusBar – design the StatusBar right on the plugin’s design surface and the StatusBar items are merged into the host’s StatusBar at runtime
- XtraPrinting – return a printable object from your plugin and the host automatically supports printing that object, along with exporting to HTML, PDF, XLS, and more (available from the Ribbon application menu)
- XtraBars Docking – visual plugins can be automatically hosted in the application as dockable windows (with customized position, caption, image, etc)
- XtraGrid support – grid layouts are automatically saved to, and restored from, XML at runtime
- Support for XtraLayout – layout controls parents on visual plugins automatically have their layouts saved to, and restored from, XML
- Automatic spell checking with XtraSpellChecker – edit controls within plugins automatically get spell-checking support
- Capable of loading Delphi plugins – by using Hydra, the host application is able to host both visual and non-visual plugins written in Delphi as well (and the DevExpress VCL components are there to give a matching look and feel)
So, what next? Now I plan on writing a Northwind DB client using the application framework. I’ll be blogging about this as the rest of the framework comes together, and eventually publish the framework with source along with the Northwind example client.
Watch here for further details.