Return to Home Page

The public review of the manuscript for "SOA Design Patterns" has concluded !
Thank you to all that participated. 234 reviews were received and over 30 new patterns have been contributed,
increasing the size of this book by over 50%. The second draft of the manuscript is currently in development.

About the Public Review
    History
    Podcasts (audio)
    Notification
    Submit Feedback
    Contribute a Proven Pattern
    Contribute a Candidate Pattern
    Acknowledgements
    Press Release

Introduction to SOA Types & Design Patterns
    The Architecture of
Service-Orientation
    Understanding SOA
Design Patterns

SOA Design Patterns
    Basic Service Inventory Design Pattern Language
    Architectural Design Patterns
    Basic Service Design
Pattern Language
    Service Design Patterns
    Common Compound
Design Patterns

Additional Resources
    View Entire TOC
    Symbol Legend
    Master Pattern List
(by category)
    Candidate Design Patterns
    Design Patterns Publications
    Download SOA Principles Poster (PDF)

About the Book



SOA Design Patterns
by Thomas Erl

For more information visit: www.soapatterns.com

Related Publications


Read the article "Introducing SOA Design Patterns" from the
June 2008 SOA World Magazine (High-Res PDF).

PLEASE NOTE

The content on this page is from the first draft of the manuscript for the upcoming book "SOA Design Patterns" by Thomas Erl. This version of the manuscript was authored in September, 2007. Since then, the manuscript has undergone significant content and structural changes as a result of an industry-wide review in which hundreds of SOA practitioners participated in addition to SOA vendors and experts from the design patterns community.

You are welcome to use the information on this page for research purposes, but you should assume that most of it will change in the final release of the "SOA Design Patterns" book.

Note also, that as a result of an industry-wide call for participation from December 2007 to February 2008, over 30 new design patterns have been contributed to this book. As they become finalized and are incorporated by the author, concise descriptions will be published on this site, and full descriptions with examples will be made available in the final, printed book.

Due to the volume of new content and changes, the release of the "SOA Design Patterns" book has been postponed to October, 2008. To learn more about the book, visit www.soapatterns.com. To be notified of updates to this site, use the notification form.

Chapter 6: Architectural Design Patterns

Home > Chapter 6 Overview > Service Agent
Service Agent

Service Agent

How can event-driven logic be separated and governed independently?

Problem

Service compositions can result in numerous extended scenarios, requiring numerous composition members resulting in increased composition logic complexity and performance overhead.

Solution

Event-driven logic can be deferred to event-driven programs that donÕt require explicit invocation.

Application

Service agents can be designed to automatically respond to predefined conditions without invocation via a published contract.

Impacts

The complexity of composition logic increases as it gets distributed across services and event-driven agents. Increased reliance on service agents can further tie an inventory architecture to vendor technology.

Principles

Service Loose Coupling, Service Reusability

Architecture

Inventory, Composition

Table 6.23 – Profile summary for the Service Agent pattern.

Problem

Service composition logic consists of a series of service invocations; each invocation enlisting a service to carry out a segment of the overall parent business process logic. Larger business processes can be enormously complex, especially when having to incorporate numerous Òwhat ifÓ conditions via compensation and exception handling sub-processes.

Furthermore, each service invocation comes with the performance overhead of having to explicitly invoke and communicate with the service itself. The performance of larger compositions can suffer from the collective overhead of having to invoke multiple services to automate a single task.

Figure 6.101 – A service sequentially composing several others to carry out a particular capability.

Solution

Service logic that is triggered by a predictable event can be isolated into a separate implementation capable of automatic invocation upon the occurrence of the event. This reduces the amount of composition logic that needs to reside within controller services and furthermore decreases the quantity of service invocations for a given composition.

Figure 6.102 – By deferring common logic to service agents, the overall quantity of explicitly invoked services decreases. Note that the tube symbols are used to show that although service agents are positioned between business service layers, they are not actually considered as part of those layers.

Application

The chosen service logic is implemented as part of a program capable of automatically responding to predefined events. Within a Web services framework, this is most commonly accomplished by the creation of service agents; event-driven programs with no published contract.

Service agents automatically intercept incoming or outgoing messages and carry out their capabilities without requiring explicit invocation. They are most commonly positioned as extensions of the utility service layer, although agents with a business-centric context can also be designed.

Vendor runtime platforms commonly provide service agents equipped with cross-cutting logic for common utility functions such as authentication, logging, and load balancing. As first introduced in the Service Architecture section of Chapter 3 (Figure 3.x), the message processing logic that is a natural part of any Web service implementation actually consists of a series of system (and perhaps custom) service agents that collectively carry out functions associated with message exchanges.

Impacts

Event-driven agents provide yet another layer of abstraction to which multiple service compositions can form dependencies. Although the perceived size of the composition may be reduced, the actual complexity of the composition itself does not decrease. Composition logic is simply more decentralized as it now also encompasses service agents that automatically perform portions of the process logic.

Overuse of this design pattern can result in an inventory architecture that is difficult to build services for. With too many service agents transparently performing a range functions, it can become too challenging to design service and composition architectures without forgetting to take all possible agent-related processing into account.

Governance can also become an issue in that service agents will need to be owned and maintained by a separate group that needs to understand the inventory-wide impacts of any changes made to agent logic. For example, system service agents can be subject to behavioral changes as a result of runtime platform upgrades. An agent versioning system may be required to address these challenges.

Relationships

The event-driven programs created as a result of applying this pattern become a common and intrinsic part of service-oriented inventory architectures. The type of logic they encapsulate is comparable to utility logic and therefore similar design considerations can be applied. For example, instead locating security logic into a utility service, the Security Centralization pattern can be applied to service agents instead.

Either way, the Service Agent patternÕs most fundamental relationships are with Service Messaging and Messaging Metadata, as service agent programs are almost always designed to intercept and process message contents.

The overuse of this pattern can lead to an undesirably high level of dependency on a vendor platform, as per the strained relationship with the Vendor-Agnostic Context pattern. This can be due to the need to build custom service agents with proprietary programming languages or because services rely too heavily on the proprietary agents provided by vendor runtime environments. Canonical Resources considerations can alleviate this, but do not directly regulate the quantity of produced service agents.

Figure 6.103 – The Service Agent pattern is responsible for produce service agent programs, which end up relating to a range of architectural design patterns.

Case Study Example

Case study content is not available on this Web site.

Prev | Next
The Prentice Hall Service-Oriented Computing Series from Thomas Erl
Home    SOA Books    SOA Magazine    What is SOA?    SOA Principles    SOA Methodology    SOA Glossary Copyright © 2007-2008
SOA Systems Inc.