Thursday, September 20, 2012

SOA, Separation of concerns and agnosticism (4/5)


Separation of concerns and interoperability

Because the contract must be interoperable we need to define contracts in a technology that is interoperable and preferably vendor-neutral by nature.

We also need to make sure that both the message protocol as well as the transport protocol are standardized as much as possible. Ie. in case we use a message protocol that cannot be supported on a specific platform or a transport which is not supported by all required platforms, this poses us with a significant interoperability challenge. Sometimes both message and transport are coupled (ie. REST), sometimes decoupled (ie. SOAP where the message protocol remains SOAP but the transport protocol can change from ie. HTTP to JMS).

For this interoperability challenge to be resolved we can choose a technology that allows for cross-platform interoperability, like SOAP, REST or plain XML over HTTP. As you can see the standards used in this paragraph are all industry standards. Industry standards are standards that agreed on and have large industry support. As an example, at the time of writing, SOAP 1.1 has more industry support than SOAP 2.0, so although SOAP 2.0 has some improvements over SOAP 1.1, personally still I would prefer the older standard.

Choosing industry standards for the technical contract, the chances of interoperability increase, as multiple different types of platforms would most likely be compatible, despite the platforms being disparate systems.

As a side note, if technology like SOAP is used, the contract can easily be designed first because WSDL (yes another industry standard) can be used to describe the contract in a standardized way (from technology point of view). This would help creating a (separately governed) contract that can be used by both the service designer as well as the service consumer designer to allow for concurrent design and delivery of both service as well as its consumer. 

Tuesday, September 18, 2012

SOA, Separation of concerns and agnosticism (3/5)

Separation of concerns and decoupling

To facilitate standardized contracts, they must be decoupled as much as possible. Decoupling can be achieved by designing the contract first, regardless of technology, back end, consumer etcetera.

A number of different coupling types can be identified. Generally speaking we distinguish positive and negative coupling types. Positive coupling types are encouraged whereas negative coupling types should be avoided. Negative coupling is anything on which the contract can form dependencies. In other words, contract-to-* coupling is considered negative coupling and *-to-contract coupling is considered positive coupling as this reduces the amount of dependencies the contract can form.

A way of achieving contracts independent of consumers and implementation is by designing the contract first. If the contract-first approach is not followed the risk exists that a number of different kinds of negative coupling find their way into the contract.

Now that we have identified positive and negative coupling types, the following can be considered positive coupling:
  • Consumer-to-contract
  • Logic-to-contract
The directly negative coupling types are:
  • Contract -to-consumer (contract depends on one or more consumers of the service)
  • Contract-to-logic (contract depends on the implemented logic’s interface
  • Contract-to-functional (contract only supports specific functional context ie. parent process)
Indirectly another set of negative coupling types can exist, ie:
  • Logic-to-implementation(logic depends on how the logic is implemented)
  • Logic-to-technology (logic depends on the technology on which it is implemented)
Because the contract can depend on the logic, the contract can indirectly depend on implementation or technology. Examples of negative coupling are situations where contracts are generated from implemented components or classes, or components generated to expose a database implementation.

Regardless of the coupling type, any negative coupling type from contract-to-logic will inadvertedly also expose an indirect level of coupling to the consumer of the service. Ie. the consumer might need to populate parts of a message to our service which represents ie. a tablename or fieldname of the underlying back end or database implementation. This will result in unnecessary changes to cascade though our services into the consumers and should be avoided in general.

Again, a fairly simple way of avoiding these kinds of problems is by following the contract-first approach. Another advantage of contract-first approach is that once the contract is defined (and hopefully also standardized as described in section 2), is that delivery streams of both service provider as well as service consumer can make their design and implementations in parallel, as the interface of the service is predefined with a clear purpose, context and meaning. This would facilitate a quicker delivery model than ie. a straight-forward sequential approach where service implementation had to be finished before the contract can be shared. This would benefit any project manager, scrum manager etc. as there is no sequential dependency before the consumer of a service can start designing and developing. This provides flexibility to the project delivery lifecycle.

Monday, September 17, 2012

SOA, Separation of concerns and agnosticism (2/5)


Separation of concerns and contracts

A significant prerequisite for separation of concerns is the fact that contracts are standardized in multiple ways. Aspects that can be standardized on a contract are the data model (service data representation standardization), and the naming and semantics of the services, operations and data elements (functional expression standardization).

Standardizing the contract forces us to separate the concern of contract design from everything around the contract, this is also called decoupling (see [3]).

A way to standardize and independently govern the contract is simply by approaching a service using the top-down approach. 

This is easier said than done, but a few pointers are:
  • Expression of functionality from the viewpoint of business and business processes
  • Naming entities from the viewpoint of the business functional area they support
  • Applying normalization and logic centralization to services
  • Creating the contract-first, only then think about the implementation

Once the contracts are designed first, there is a natural decoupling of contract and logic, as the contract ideally should not expose any implementation details. The separation of concerns is reached specifically by the contract-first approach as this does not allow implementation-specific details to trickle down into the contract.

Saturday, September 15, 2012

SOA, Separation of concerns and agnosticism (1/5)


Middleware and Separation of Concerns

Middleware can exist in many ways but most common approach is either the application service or the ESB approach. Regardless of what platform or technology the middleware is hosted on, the main  purpose of the middleware layer is the same: separation of concerns.

As an example the following picture shows that the middleware decouples the consumer from the back end systems by providing services that act on behalf of the back end. This way the consumer does not need to be concerned with the back end, and the back end does not need to be concerned with who the consumer is or how it works.

Decoupling should be explained a bit further. Two systems are coupled if there is a dependency between the two. What we try to achieve with decoupling is that we try to minimize the amount of dependencies between them.

Separation of concerns can be observed in middleware in many ways but starting with offering services on the middleware platform allows us to wrap back end systems. This then allows us to offer a standardized way of accessing underlying back end systems. Standardizing the access to logic can improve interoperability. To provide increased opportunity of interoperability, we need to understand that we have to standardize contracts. If two systems are interoperable it means that they can easily exchange information, or in other words, cooperate. If we put in lots of effort we might be able to provide a system that has something called intrinsic interoperability.

Intrinsic interoperability is achieved if we have standardized a system in such a way (and if we have built logic in such a way that the interoperability can be supported) that if two systems exchange messages, the messages can be easily understood, without the need for (complex) transformations or translations.

For intrinsic interoperability to be achieved, a number of prerequisites must be met, and even then matters are not easy and require significant amount of attention in the governance area.

Friday, September 14, 2012

SOA, Separation of concerns and agnosticism (0/5)


Separation of concerns and agnosticism

Separation of concerns and agnosticism are two closely-related terms. Where separation of concerns is a term commonly used in object-oriented and component-based technologies, it is a way to clearly separate functional concerns by defining containers (services, classes, components) to identify a functional boundary of the contained operations.

Agnosticism (from the Greek word agnostos) is a term traditionally used in religion-related discussions but also in the world of service-orientation to explain that the service is not aware of, or is not concerned with, the parent functional context. Gnostos means “aware of the existence of”, the “a-“ is a negation making the whole term’s meaning “not aware of the existence”.

Both terms convey a similar concept where we keep concerns of a particular piece of code local to that piece of code only, and not have it scattered across the software infrastructure. The term agnostic however intends to apply to a wider scope than only code or logic, for instance on the contract or on the service as a whole, as well as the entire service inventory structure.

This five-part series touches on several aspects of how separation of concerns can be achieved in a service-oriented solution.

Tuesday, August 7, 2012

Just finished reviewing Thomas Erl's upcoming book SOA with REST

Hi all,

I just finished reviewing the upcoming book SOA with REST, written by Thomas Erl et al.

For more information about this no-nonsense book, see the SOA with REST infopages.

- Roger

Monday, August 6, 2012

Now official trainer for the Service technology Symposium

Now I am also official trainer for the Service Technology Symposium, for training partner Rhea Solutions Ltd.

For the training program see the training web site.

I am conducting the pre-symposium Certified SOA Architect Workshop. Also see the Symposium's Workshops Guide.


Now official speaker at the Service Technology Symposium

Hi all, now I am


For more details see: the official Service Technology Symposium web site, and the presentation abstract and speaker profile for "Conway's Law and Service Orientation".

- Roger




Wednesday, February 1, 2012

Published the Centralized Event Consumer candidate pattern

Hi all,

I just published the Centralized Event Consumer SOA Pattern. The pattern increases autonomy of underlying resources in large event architectures, thereby increasing the event consumer autonomy.

You can view the pattern by following the link.

I would like to ask everyone to review & give feedback on the soapatterns.org website. Also in case you have used the pattern yourself successfully, please testify this at soapatterns.org using the feedback form, so the pattern candidate might be qualified as a real pattern.

- Roger

Thursday, January 26, 2012

Published an article in Service Technology Magazine

Hi all,

I just published an article in Service Technology Magazine - the January 2012 edition.

For those of you who read my blog it might be familiar text as I took one of my posts as basis for the published article. For those of you who want to check it out you can see it here.

- Roger