Sunday, January 11, 2009

How far can you go with loosely-coupled?

When we were building the Definition-based Dynamic Engine (DDE) with EJB on IBM platform, I wanted to have a multi-layer loosely-coupling on data model, i.e. persistent data layer, processing layer, and presentation layer. Which means the data schema in the persistent data layer is independent from data container structure in processing layer, and display fields in the presentation layer.

Why is this multi-layer loosely-coupling data model important to DDE? As the Ubikwiti's dynamic business applications running on DDE are constructed from many business components which are developed ("defined") in XML files that consists of the GUI definition, business rules, business processes, business objects relationship and data format, we can't fix in design time where to store the persistent data and its schema, what information and business rules to be processed by each business component, and what to display on the screens or reports. Without this level of loosely-coupling, the business components (the LEGO blocks of Ubikwiti application) will be very rigid and limited in terms of customization and extension.

In EJB, we first tried Entity Bean, but it was only okay for persistent data management but not flexible enough to be used for process layer, and not possible for presentation layer. We then tried Service Data Object (SDO), the latest SOA related technology at that time. The concept was very promising. We first started with SDO comes with WebSphere Application Server (WAS), but changed to Tuscany SDO due to IBM SDO didn't come with good XML Data Mediators Service (DMS). 

We thought the Tuscany SDO can help us to achieve the multi-layer loosely-coupling already, but unfortunately, the data graph created from SDO is tightly-coupled with the persistent data schema. Either we were expected too much from SDO or it didn't deliver as promised.

At the end, we achieved the multi-layer loosely-coupled data model by creating our own Data Transfer Object (DTO), which became the only data container for GUI, Service Object Manager, Business Object Manager and Business Object. The Business Object is still using the Tuscany SDO for persistent data management. Each DTO is initiated in runtime and constructed the data graph(s) in it from a XSD file that defines the schema and restriction. A mapping XML file is being defined if DTO data graph transformation is required from a layer to another layer. We also serialize/de-serialize the DTO for passing the DTO between the client tier and application server tier. 

If you can understand what I explained above, you should be able to see how powerful and flexible this multi-layer loosely-coupled data model is, and how much potential the Ubikwiti Platform can be. If I didn't explain well enough and you have interest to know more, please drop me a comment.

So, how far can you go with loosely-coupled?

 

No comments:

Post a Comment