Saturday, May 3, 2008

SOA & Canonical Modeling

There has been a number of discussions in various articles and blogs on the topic of application and value of canonical modeling for SOA. Majority of industry experts support the use of canonical models as one of the key SOA patterns. However, there are some that consider canonical modeling as detrimental to SOA (http://service-architecture.blogspot.com/2006/08/single-canonical-form-not-for-soa.html). I would like to add my voice to those that consider canonical modeling a critical aspect in the success of the SOA program.

Primary goal of any SOA program is to introduce a variety of reusable services. Reusability typically implies that a service has a number of different consumers and data providers. The first and most obvious value of a canonical model is that it acts as an abstraction layer between all those consumers and providers. It is an old and well-known design pattern – when you have a number of data sources and their consumers that need to be integrated together, you introduce an abstraction layer, so that neither is aware of the internal details of the other. This way, any changes made to a consumer or a provider will have minimal impact on all of its integration points. This is the second benefit of using a canonical model. It minimizes the impact of internal service changes, modifications of data sources, or switch to a new backend data source on the service consumers. The canonical model should remain unchanged regardless of what happens inside the service, which, in turn, ensures that the contract between the service consumer and the service itself remains unaffected. The maximum possible impact on the service may be the need to change the mappings between internal service data structures and the canonical model.

Since the canonical model minimizes the impact of internal service changes on its consumers, it also reduces the need for regression testing. (This is the third benefit of canonical modeling.) If services did not provide a layer of abstraction between its internal implementation, backend data sources, and its consumers, any change inside the service or data provider would be reflected in its interface and thus would require a full regression test. Usage of a canonical model eliminates the need to perform rigorous regression testing since, as we discussed above, any such changes would not impact the service consumer. The only thing that would need to be done is perform a test validating that the service contract did not change.

Representing standard structures in a canonical model maximizes service reuse (fourth benefit). Consider all the entities that your business deals with every day. It could be customer, account, price, payment, etc. However, different parts of the organization may view these entities differently. One division, for example, may care about the customer household information while other about his/her geo-positioning. Without a canonical model, you would end up with multiple slightly different representations of the same entity. This results in services being built based on disparate models targeted for only specific audiences. Other groups trying to reuse these services would require changes to address their needs or would simply not be able to consume them. Representing all entities in a standard way eliminates this incongruence and allows different parts of the organization to speak the same language. This, in turn, maximizes the potential and real reuse of services built across the company.

Of course, some would argue that any changes to the canonical model would impact all of the service consumers and they would be right. In order to minimize this risk, a façade pattern needs to be used. Rather than exposing the canonical interface directly to the consumers, a façade would need to be build based on each consumer’s needs. It would expose data contracts specific to each consumer or a group of consumers. The service would never be called directly but only through one of its façade interfaces. This way, any changes made to the canonical model would not impact the service consumers directly. The façade would remain intact. The only change that would potentially need to be made is modification of mappings between the façade and canonical data structures.

Used together, the canonical modeling technique and the façade pattern will maximize the service reuse and minimize the impact of internal changes on service consumers. The approach will save costs and time on regression testing efforts. Regardless of what the opponents say, use of these techniques is critical to the overall SOA program success.

Links to some good SOA & canonical modeling articles:
http://www.it-eye.nl/weblog/2007/06/13/soa-best-practice-9-use-a-canonical-data-model/
http://www.ibm.com/developerworks/db2/library/techarticle/dm-0803sauter/
http://www.soapatterns.org/canonical_interface_expression.asp
http://reallifeserviceorientedarchitecture.blogspot.com/2007/11/how-to-create-canonical-form.html

8 comments:

Anonymous said...

Its an awesome blog for ..
architects in bangalore as modern architectural firm working asinterior designers in bangalore know more about Green eco architectural designs are reusable materials, green designs etc.. ..… Create an Eco friendly Green design… Save Earth.. interior designers in Bangalore as of natural materials interior designers in Bangalore with almost modern concepts architects in bangalore eco friendly architectural solutions for architects in bangalore Carbon Footprint is a measure of the impact human activities have on the environment in terms of the amount of greenhouse gases produced, measured Architects in bangalore so save earth for a better future..

Healthcare and IT Professionals said...

SOA is a reliable and good program to resolve the existing services.
shopping cart

Anonymous said...

This link has helped me a lot to decorate and also make some changes in my apartment. I saw it on the net when I was trying to get information about buy viagra

Anonymous said...

I'm so hold on firmly to the idea of learning more about architecture as well as we can learn a lot about things like buy viagra

Fakhruddin40 said...

I think canonical modeling is a critical aspect in the success of SOA programming.

Plastic Card

Inventory Management Software said...

Thanks for sharing your post and it was superb .I would like to hear more from you in future too.
Regards:
Inventory Management Software
http://www.blackitsoft.com/inventory-pos-software.aspx

A.Armin said...

It was awesome man, I really enjoyed when I red it because it was exactly related to my problem area.
I got the main concept and it make me a new view to architeture's realm.

navya said...

Great Article...
WCF Online Training
WCF Training
Online WCF Training from India
WCF Training in Chennai