Madura: a major update

ArchitectureI’ve been working on this thing for the last few months and it is an update of something that I already had out there. The previous version required a lot of XML to configure the Spring context correctly.  This version cuts that down to a bare minimum making it all much simpler to create applications.

The basic idea is to make Java objects (Customer, Order, OrderItem and so on) smart enough to do really complex validation, but without actually adding code to them. From the calling application it looks like that’s where the code is, making the application code much simpler. But it is actually elsewhere, which simplifies maintenance no end.

I’ve worked on a lot of Java projects where developers need to know the full dev stack, from bits of javascript to implement business rules that require buttons to enable/disable in certain situations, right down to complex validation in Java back end processing. A fairly constant question during maintenance is ‘where is that implemented?’ The guy who built that bit probably knows, but he’s gone.

My approach cleanly decouples the business rules from the application code, keeping the application code simple. Application code developers don’t need to know the business rules. Business rule developers don’t need to know how the application code works. Neither needs to know much about the UI.

I’ve added a Vaadin UI module to make it easy to work with Vaadin (my favourite UI technology www.vaadin.com) so you get smart forms that ride on the self validating objects and take advantage of the way the rules dynamically derive more data from user entries (eg they add up the total of the order items) and switch fields from visible/invisible etc. One of the coolest things is the pizza order (in the RulesDemo example http://rulesdemo-madura.rhcloud.com/) where several drop-downs interact with each other to only present valid options based on earlier selections.

On top of this I’ve built a full workflow system that allows you to add processes that make use of rules for both the smart forms and directing the flow of the process.

All open source and (almost) all Apache License 2.0, which means you can use it however you want for free. The exception is the rules engine which is GPL 3.0 ie free for non-commercial, not so free otherwise.

Lots more detail on the Madura Software website.

#java #vaadin #rules #workflow

Leave a Reply

Your email address will not be published. Required fields are marked *