Recently we made the decision to clone our Winforms VideoRent real world application and create a new XAF application – the XVideoRental. Wearing my LEGO designer hat I will go through all migration steps as if I were in your shoes.
Real world applications are really demanding. We spend huge times for first release and in most cases is very poor compared to the next ones. The reason is simple, we do not have enough time to prepare a domain-specific language (DSL) that will bridge business requirements with our existing technical tooling/knowledge. Therefore we try to re-invent the wheel in many areas whereas XAF exists as the most comprehensive tooling available. Using application model and the Security System, XAF fully describes and configures the behavior of platform agnostic applications. Both Application Model and Security System are the technology abstraction or in other words the DSL language we need to minimize the time to market cost of a real world application.
In short the legacy app is using 256 classes. The XVideoRental much less 77 and 90% or them are simply concrete implementations from the referenced project agnostic library. However in the 3rd row where this project agnostic library is replaced from a reference to our open source project that number of classes goes further down to only 36!
Legacy VideoRent | XAF XVideoRental |
Data Access | |
• Legacy app uses ORM technology and our XPO to describe the video rent business. However special skills needed and extra efforts to create a clear separation from other layers, so many helper classes exists even for very common tasks such as database connectivity. | • XAF has built-in support for both XPO and MS Entity Framework. We can simply utilize the legacy domain model by simply copy- paste the classes. Helper classes are of no use because XAF can handle all common tasks transparently for us! |
• A real world application requires an importing mechanism for initial data. The legacy app imports data from xml files with structure that fits exactly to the structure of the business objects. Therefore even for a small change in the BO design we need to modify and retest this mechanism. | • XVideoRental plugs-in an abstract domain agnostic importing engine from Fast prototyping requires an initial data import mechanism, allowing us to modify the structure of BO in the minimum time possible. In addition how to Supply Initial Data is well documented sparing our time for making architectural decisions. |
• In a real world application sequential number integration is essential. However special design and knowledge is needed to be able to build something reliable. | • XVideoRental operates under a business application framework therefore a rich click and run SDK provides solutions to such common problems E2829. So the developer only needs to integrate and not to think about the technical difficulties or guess the showstoppers. |
Architecture | |
Legacy app has a design time modularization based on Forms/UserControls/(Bussiness Concept). However it is not possible to extended it without adding new Forms and recompiling the whole application inside VS. In addition because of the lack in documentation determining the best place to write code for a specific behavior can still cause big headaches. Application life cycle is component centric and was invented on demand for the current application. | XVideoRental demo is using XAF’s well-documented and simple to use MVC architecture. Also, while the discussed application is a simple fat client app, demanding users looking for something more advanced may also find a ready to use client-server solutions in XAF. • VS templates to fast create modules. which by design are reusable and independent from main application. • Well documented Application life cycle guide us where we to write code (e.g. Setup, Login, View Activation etc.) • Simple to follow tutorial on how to Extend Functionality. • Detailed guide of all the main concepts for building business applications. |
Data Validation | |
A real world application without strong validation support is unstable and has huge support times. Building a validation engine is not trivial at all and requires third party components which will raise the cost even further. Therefore the legacy application time frame and budget wouldn’t allow any investment here and there is no validation support. | Creating validation rules does not require you to be a developer, even end-users can create them because it is quite easy and intuitive, not more difficult than creating a filtering rule in your Outlook. We only need to install the build-in Validation module!
|
Data Representation | |
The legacy application a large number of components. Therefore the developer requires A huge amount of mundane, repetitive work was invested to: | XAF has native support for a large number of DX components. Automatic UI generation (CRUD detail and list forms, navigation and menu systems - all based on data models). This is a huge time saver because almost every typical business application contains a good percentage of list and detail forms, navigation and menu systems - all linked together without any effort from your side. |
• Create a large number of data entry forms, drag & drop numerous controls on it, arrange their positions and configure data bindings • Providing a consistent look and feel is not an easy job and requires deep knowledge of a large number of components as well as a special design • Interact with the database through XPO, create CRUD operations and support transactions needs careful considerations and a lot of time, so it was done as basic as possible by simply pushing non mandatory tasks such as undo operations and transaction for the next application release . • In an agile real world the navigation menu system should be controlled as declaratively as possible. However legacy app does not conform this requirement resulting in huge update times for every customer request. • Extend XtraReports for every Business object we want to create reports. • Design reports inside VS making their support impossible in real world. • Design analysis views inside VS making their support impossible in real world. | • We plugged-in a mechanism that allows to control any component at runtime from Dressing up our classes – Date with a model tonight!. • A business rule driven Pivot editor borrowed from How to rule the Pivot we showed how to marry business requirements with a complex component like Pivot. • Legacy code was converted on the spot to declarative as in Tooltips to the max - expressive UI. • From Visiting dashboards we add a ready to use extension that provides collaboration for our views. • We went over expectations by simply installing a community module from Dashboards in the real world – A Scotland strike. |
Application Configuration | |
Although most of the components can persist their state there is no application level integration by default. In addition their serialization is not designed to be human friendly and its hard to edit and support. The legacy developer had to create an integration mechanism deep in application’s infrastructure. This costly. wrap-up was as basic as possible and target only a few major forms producing a non consistent feeling. | XVideoRental is a XAF application which by design is described declaratively in XAF’s Application Model. Using Model Editor at runtime an end user can modify any part of the app. However we didn’t spend the 10 min required to plugin the ModelDifference community module and consume the application from a persistence storage such as a database cause we were building a clone and not demo the endless features of XAF! Zero migration resources for this one!
|
Application Security | |
The legacy developer tried to create a basic security implementation. However he soon realized that the efforts needed for something useful and reliable will probably exist the efforts for building the whole application. So, unfortunately due to app budget there is no investment in implementing a security system. | Our time frame here was really loosed since we already have a mature plug n’ play Security module. This flexibility allows us to plugin more goodies such as User Friendly permissions and metadata based permission policies
|
Reporting | |
The major goal of business applications is to be able to create and print reports. Therefore the legacy app has a dedicated project for reporting. In which the developer had to use Visual Studio for report design. As a result he loosed any chance to update them on demand after project distribution which is a really common case. At the same time the reports were extended and bound to VideoRent business objects making the whole implementation not reusable from any other project.
| XVideoRental uses the built-in Reports Module which natively integrates our award winning XtraReports suite and provides a runtime designer. The module saves the reports in the database so our job was to copy paste the Reports layout from the legacy app and distribute them as discussed in Distribute the Created Reports with the Application. Moreover we provided collaboration/filtering with other views using as usual a no code approach as discussed in Visiting dashboards. |
Data Printing and Export | |
The legacy developer had to write special code for each control on your forms that he wished to print or export. Although this functionality is very useful in real world again the time frame wouldn’t allow such an investment.
| XVideoRental can export data from the grid, pivot, chart, tree view, layout and others to a wide number of formats (PDF, RTF, TXT, CSV, HTML, MNT, XLS, XJSX, PNG, GIF, JPG, BMP, TIFF, WMF, EMF) without spending not even 1 minute to install or configure the system! You probably can guess why eh? As usual XAF has a built-in generic mechanism for all controls out of the box! |
Data Analysis | |
Legacy app has a whole structure to support only a few data analysis views for the 4 major BO which are Customer, Movie, Receipt and Rent. Huge amount of code is located in dedicated forms for each analysis views making the solution not able to survive in real world. The reason of course is that for each new customer request the developer has to change the code inside VS recompile and redistribute the app. A common example is a calculated value where it needs a UI to define these members, special algorithms to create them | XVideoRental uses the build-in Pivot Chart Module which as usual shifts development to the runtime allowing business users to modify the analysis display at any time. Uses the extended Pivot from How to rule the Pivot. Empowering the app with the dashboard suite as in Dashboards in the real world – A Scotland strike! was as simple as drag & drop the module from VS toolbox!. Essential for data analysis runtime calculated members as in Domain Components+ Calculated properties + Application Model was in the menu as well.
|
Localization | |
There are technics for localizing .NET application via satellite assemblies however they do not localize application specific data and they are very time consuming, so the legacy app does not support any kind of localization
| XAF supports all standard localization approaches and also addresses the problems that occur with them. With XAF, it is always possible to localize any part of your application at runtime (e.g., correct certain values from satellite assemblies). A convenient wizard provides the capability to use online translation services from MS, Google, etc. So, it is possible to leave the localization job to non-programmers who can easily import/export data without leaving the application. |
Customizing Controls Appearance | |
Even for the simplest operation like making bold a grid column or hiding a control from a view developer time is needed as long as recompilation and redistribution of the application | XVideoRental addresses this declaratively using the Conditional appearance module and the technic described in Dressing up our classes – Date with a model tonight! where any component can be serialized and controlled declaratively from XAF’s application model using the runtime Model editor. This is control-agnostic and we spared our time digging into the specifics of each control – XAF did everything for us!
|
Implementing Custom Business Requirements | |
Lets talk a concrete example here. The legacy app uses tooltips to create a more expressive UI. However even if the developer wrote a decoupled class at the end he has to attach it to various controls and forms. This makes the whole design not flexible since changes require developer presence. | XVideoRental can use the same decoupled class from the legacy application. However it simply attaches the behavior to application model instead of attaching it to controls and forms. This solution is project agnostic and allows later changes from a non programmer at runtime! This process is discussed in details in Tooltips to the max - expressive UI.
|
Getting Help and Support | |
Application and developer are simply married. If for any reason they divorced then everything becomes very unstable and tricky. It is really hard to find another developer to continue support a legacy app. Even if we manage to do so the cost will be extremely high since there are no docs, support etc. | XVideoRental uses bricks/samples from XAF’s code central and community project. Thus by design there is a large number of developers that can support its code base. Not to forget the unmatched documentation and support we can get from the XAF team.
|
| |
Even thought XAF does not contain solutions to each and every business problem in the world, the framework is very strong in providing its own extensibility ( "preventing the lock-in effect"). It is fast and easy to plugin solutions to common business problems, at the end XAF is a Domain Specific Language that that can bridge business requirements with our existing technical tooling/knowledge!