Best Practices: SOA Application Design Analysis

Modularization and reusability

One of the benefits of SOA is that atomic business components can be wrapped as services and re-used over and over again in forming high level business functions. SOA makes it easy to accomplish this by standardizing the ways services interoperate with each other. And because ActiveVOS is built on SOA standards, it can both consume and produce services that conform to the web service standards with little effort. ActiveVOS allows invocation of one process from another process without the overhead of SOAP encoding and message dispatch. And you can invoke a process as a sub-process, which allows for the sub-process to participate fully as a part of the calling process, enabling exception and compensation handling across the process boundaries.

So how do you to decide when to use processes and sub-processes? In a bottom-up approach, you start by designing your process with the goal to carry out a simple business function and then expose it as (web) service. Doing so allows you to reuse it by other higher level business processes and consumers. In a top-down approach, you first define your high-level business process and determine whether the process can be sub-divided into smaller, more manageable and loosely coupled sub-processes. It may not always be clear how and when to modularize a process until you have built many more processes that might need to consume reusable sub-processes. Watch for the following signs when determining if modularization is needed:
  • The process is extremely large and complex and it becomes very difficult to navigate, understand, debug issues and track changes
  • The process consists of many scopes or units of work, whose boundaries are very clear (but may not have been defined)
  • There are many repetitive patterns/blocks in a process and they only differ in the content of the variable and messages that are used inside these blocks
  • Many processes contain code that share the same logic and you have to copy and paste between them
If you decide to use processes or sub-processes, pay attention to the following:
  • Design the interface of your sub-process carefully to avoid introducing unwarranted constraints that might hinder its reuse
  • Balance the need of performance and manageability vs. the need of reuse
  • Take care of passing transaction context or coordination between processes - use sub-processes whenever it is appropriate