Welcome!

SOA & WOA Authors: Jason Bloomberg, Ian Khan, Sandi Mappic, Liz McMillan, Adrian Bridgwater

Related Topics: SOA & WOA

SOA & WOA: Article

Introducing SOA Design Patterns

The SOA community collaborates to produce a master pattern catalog dedicated to SOA

Fundamental Service Design
At the most basic level of service design, the established "separation of concerns" theory needs to be applied as part of a process whereby a larger problem is decomposed in a way that we can clearly identify how corresponding solution logic should be partitioned into services. To accomplish this, a series of base patterns have emerged to form a fundamental pattern language that can serve as the basis of a primitive design process.

Examples of these basic patterns are Functional Decomposition and Service Encapsulation, both of which help determine what type of logic does and does not belong in a service. Additional patterns, like Agnostic Context and Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service (see Figure 3).

Service Implementation Design and Governance
A key pattern frequently applied to the initial design of service architecture is the Service Façade. Inspired by the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. This is really nothing new, but it does establish an architectural foundation that can be leveraged by other more specialized SOA patterns.

For example, Service Decomposition (one of the service governance patterns) allows a coarse-grained service to be split up subsequent to its deployment. Additional governance patterns, such as Proxy Capability and Distributed Capability (see Figure 4), help ensure that this decomposition of one service into two or more does not impact the contract (technical interface) of the original service, thereby also avoiding impact to that service's consumer programs.

Other patterns, such as Legacy Wrapper, Redundant Implementation, Service Refactoring, and Service Data Replication, can be selectively used to address various implementation and scalability-related requirements, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required.

Service Contract Design and Governance
A key design pattern that helps increase the longevity of service contracts (to postpone versioning requirements) is Contract Denormalization. This pattern essentially explains how capabilities with overlapping functional scopes can be added to a service contract without negatively impacting service or inventory architectures. This results in the contract's technical interface exposing similar functions at different levels of granularity, allowing the same contract to facilitate the requirements of different types of consumers.

Alternatively, multiple groups of consumers can be accommodated by the Concurrent Contracts pattern that describes how entirely separate contracts can be created for the same underlying service logic. Security restrictions or a need to split up policy alternatives for reasons of governance can also result in the requirement to employ multiple service contracts. This pattern also benefits from the existence of a service façade that can be positioned to coordinate incoming and outgoing data exchanges across multiple contracts but with a single body of core service logic.

Part of these governance patterns includes various contract versioning design techniques to minimize the impact of having to introduce new contract versions or support multiple versions of the same contract. Some governance patterns are reactive because they help solve unexpected governance-related design issues, while others are preventative in that they can be applied prior to the initial deployment of a service in order to build in additional flexibility that allows the service to be more easily governed and extended over time.

Patterns for Service Composition and Communication
As an aggregate set of services, a service composition establishes its own unique architecture encompassing the individual service architectures of the composition members and introducing additional design requirements focused on inter-service communication and runtime activity management. It's therefore no surprise that many design patterns have emerged to address composition-related design issues.

There are several key design patterns that establish the mechanics behind inter-service communication. Due to the popularity of building services as Web Services, several of these design patterns are based on messaging, and some are focused solely on asynchronous messaging. For example, the Asynchronous Queuing design pattern establishes a central queue to allow services to overcome availability issues and increase the overall robustness of asynchronous data exchange.

The marriage of SOA and EDA has resulted in the Event-Driven Messaging pattern that enables publish-and-subscribe functionality between services over extended periods. This can go hand-in-hand with the use of the Service Agent pattern that introduces an additional event-driven dimension into composition architecture by allowing you to defer various types of cross-cutting logic to transparent agents that intercept and forward messages at runtime (see Figure 5).

The Intermediate Routing pattern takes this a step further by providing intelligent agent-based message routing that can also help increase the overall scalability of services and compositions.

Very much related to supporting service messaging and the hosting and execution of service compositions as a whole is the Enterprise Service Bus compound pattern. As shown in Figure 6, this pattern establishes an environment comprised of multiple other patterns, such as the aforementioned Intermediate Routing and Asynchronous Queuing patterns in addition to the Broker pattern (that in itself is also a compound pattern that represents a set of individual transformation patterns).

Note that there are additional design patterns associated with the Enterprise Service Bus compound pattern, several of which are classified as optional extensions to a core model. Other design patterns that tie into service composition architecture include Cross-Service Transaction, Composition Autonomy, Reliable Messaging, and Agnostic Sub-Controller.

More Stories By Thomas Erl

Thomas Erl is a best-selling IT author and founder of Arcitura Education Inc., a global provider of vendor-neutral educational services and certification that encompasses the Cloud Certified Professional (CCP) and SOA Certified Professional (SOACP) programs from CloudSchool.com™ and SOASchool.com® respectively. Thomas has been the world's top-selling service technology author for nearly a decade and is the series editor of the Prentice Hall Service Technology Series from Thomas Erl, as well as the editor of the Service Technology Magazine. With over 175,000 copies in print world-wide, his eight published books have become international bestsellers and have been formally endorsed by senior members of many major IT organizations and academic institutions. To learn more, visit: www.thomaserl.com

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.