SOA and OPF Dilemma

Recently, I have been relooking into my Paladin framework as I hope to incorporate some SOA concepts into it. So far, I have built Paladin to be an Object Persistent Framework (OPF) and have included many optimized features that developers can use with minimal code. After reading about SOA, I was quite excited and hope to SOA-enable parts of my framework.

I also have the opportunity to look at KahFui's MyEnterprise.NET which demonstrates the designs of an SOA system. So I started taking apart my framework to look at it and I encountered some design conflicts. Originally, this is how a developer would save information in the OPF style:

Customer cust = new Customer();
cust.Name = "Firedancer";
cust.Gender = 'F';
cust.Update();

In SOA, I have to introduce a new BusinessComponent. The code is revised to:

Customer cust = new Customer();
cust.Name = "Firedancer";
cust.Gender = 'F';
BusinessComponent bc = new BusinessComponent();
bc.Update(cust);

Although I had some problems initially with the Cascade update/delete operations in SOA, I was able to solve it within the framework. However, I hit an uneasiness when I realised that my OPF entity objects could be residing on different databases. Example, Customer in DB01 and Orders in DB02. With the OPF style, developers will have no problems. Infact, it is transparent to the developer as all he/she needs to do is just to call Customer.Update() and the whole object hierarchy will be persisted correctly.

However, in SOA, the following code will be needed to do the job:

BusinessComponent bc = new BusinessComponent("DB01ConnectionSetting");
bc.Update(cust);
 
BusinessComponent obc = new BusinessComponent("DB02ConnectionSetting");
foreach(Order obj in cust.Orders)
{
    obc.Update(obj);
    foreach(OrderItem objItem in obj.Items)
    {
        obc.Update(objItem );
    }
}

I think this is quite tedious for a developer. Now, I'm slowly trying to digest the SOA concepts. A blog from Rockford Lhotka cleared my mind. Furthermore, I did a simple testing by exposing Paladin entity objects through a web service and I discovered that the objects are exposed nicely in the SOAP envelope (even better than the DataSet).

Therefore, I conclude that I was confused by the two concepts and now I can understand the implementations of both better. It was a worthwhile exercise and I managed to discover some news ways to boost performance in Paladin. Well, stay tune for the next release of 0.8.6   ;)

No comments:

Post a Comment

Popular Post