Tapestry for Nonbelievers
A new article by I. Drobiazko and R. Zubairov introduces v. 5 of the Apache Tapestry component-oriented web framework. The tutorial shows how to create a component and covers IoC in Tapestry and Ajax.
Tracking change and innovation in the enterprise software development community

Posted by Boris Lublinsky on Jul 26, 2007 08:18 AM
The majority of SOA publications are concentrating on definition and implementations of the individual business services. Building enterprise solution(s) typically requires combining multiple existing enterprise services. These composite services can be in turn recursively composed with other services into higher level solutions, and so on. Such recursive composition of business services is one of the most important features of SOA, allowing to rapidly build new solutions based on the existing business services. As the amount of individual business services (and their compositions) grows, the easier it becomes to implement new enterprise solutions.
This composition approach is a natural fit for implementing systems, based on the hierarchical decomposition. Every level of hierarchy is implemented as an independent composite service, coordinating execution of lower level (composite) services. It is also a common way of modeling high level solutions in workflow systems by composing a series of activities, each of which may correspond to a lower level business process, or a task to be performed by a person or a program. While any composite service may be monitored or interrupted by the outside system using it, it does not support any other functional interactions1 with the service consumer except for an original invocation.
SpringSource Launches New Application Server without Java EE
Create a photo album application with Project Zero and REST design principles
IBM Web 2.0 Developer eKit: Free Tutorials, Webcasts, Whitepapers
Info 2.0: IBM's vision for the world of Web 2.0 and enterprise mashups (Webcast)
Introducing the SpringSource Application Platform
Although the black box composition approach (hierarchical composition) is a very powerful way of dealing with complexities, there are situations when a consumer needs to control execution of the composite service based on the intermediate execution results of service execution. Such an implementation is supported by conversational composition. In this case the implementation of the composite service is also completely opaque to the service consumer, but selected intermediate execution results are exposed (grey box).
This is achieved by supporting an explicit conversation state (see [4] for distinctions between conversational and execution state) by composite service and exposing multiple interfaces to a service consumer – one for the initial service invocation and others to get intermediate results and control execution based on them (Figure 2)
Figure 2 Conversational service composition
In this type of composition, the interacting consumer and provider are viewed as peers, exchanging data and control signals.
Both interaction styles are viable ways of compositions design. Usage of a strict hierarchy is a useful approach for modeling of complex business processes, as demonstrated by the success of workflow technology. Conversations, on the other hand, have an expressiveness that makes it easy to capture common business interactions – the acts of negotiation, monitoring of results, and so on – through explicitly modeling the message interactions between a consumer and a service.
The design of composite services does not only require the definition of the service interactions, but also a set of components and topologies for their implementation. There are two major design approaches to composite service topologies ("Service–Oriented Composition in BPEL4WS"):
Mediator-based topology (Figure 3) assumes a single service, called the mediator, which has the specialized role of interacting with the service consumer and controlling the execution of the other services (component services) participating in composition.
Figure 3 Mediator-based composition topology
In the case of mediator-based hierarchical services, the mediator implements an orchestration schema that defines invocation sequence of component services in order to achieve a specified goal within specified constraints. Different approaches, including orchestration language/engine, OWL-S compositions, Petri nets, etc. can be used for mediator implementation.
In the case of mediator-based conversational services, the mediator implements service states and states transitions, based on the consumer inputs. A typical implementation of the mediator is based on the transition systems or finite state machines.
In the case of peer-to-peer topology there is no notion of a mediator service. Every participating service (component service) can execute (partial) composite service (Figure 4).
Figure 4 Peer-to-peer composition topology.
A composition, in this case, is defined as a messaging template and component services can be plugged into it. The target behavior is specified as a family of permitted message exchange sequences, which should be realized by the system. Typically this topology is used only for the implementation of the hierarchical services due to the lack of mechanisms required for support of the conversational state (requirement for conversational interactions implementation).
It seems like the simplest way to implement a service mediator is to use a general purpose programming language (Figure 5).
Figure 5 Programmatic implementation of composite service
Unfortunately, this solution suffers from multiple drawbacks:
Despite the fact that there are several frameworks for the implementation of composite service (for example, WS-CAF), the programmatic implementation of composite services does not seem to be the right approach.
Another possible approach to the implementation of composite services is event-based composition. This composition implementation is based on event-based service interactions: service consumers publish events to the publish/subscribe intermediary, which delivers them to the actual service consumers (Figure 6).
Figure 6 Service interaction through Pub/Sub
In this case, the pub/sub engine, as any intermediary, provides a decoupling layer between service consumers and providers, which allows for extremely flexible implementation of composite services. The composite service can be implemented as follows (Figure 7):
Figure 7 Implementing composite service using events
The service consumer sends the initiating event that is delivered (through the pub/sub engine) to a set of services that have subscribed to this event. Every service can, in turn, send another message, which will invoke (through the same pub/sub engine) yet another set of services. This sequence of events effectively creates a composite service. The implementation of composite services through pub/sub has the following characteristics:
Figure 8 Implementing composite service using orchestration engine
This implementation improves the programmatic implementation by using orchestration language instead of general programming language for composition implementation. This allows programming/maintaining composition logic using visual editors, tailored specifically to simplify this kind of programming. It also allows utilizing the power of orchestration engines providing built-in capabilities for asynchronous invocations, state management, compensation support, etc. Usage of orchestration engines for composite services implementation provides the following advantages:
Based on the above, out of the three discussed approaches, the orchestration-based implementation seems to be the most viable way for creation of the composite services.
Service composition plays a significant role in SOA implementations by providing the following benefits:
Boris Lublinsky has over 25 years experience in software engineering and technical architecture. For the last several years he focused on Enterprise Architecture, SOA and Process Management. Throughout his career, Dr. Lublinsky has been a frequent technical speaker and author. He has over 40 technical publications in different magazines, including Avtomatika i telemechanica, IEEE Transactions on Automatic Control, Distributed Computing, Nuclear Instruments and Methods, Java Developer’s Journal, XML Journal, Web Services Journal, JavaPro Journal, Enterprise Architect Journal and EAI Journal. Currently Dr. Lublinsky works for the large Insurance Company where his responsibilities include developing and maintaining SOA strategy and frameworks. He can be reached at blublinsky@hotmail.com
1. Ali Arsanjani. Toward a pattern language for Service-Oriented Architecture and Integration, Part 2: Service composition. Developworks, December 2005.
2. Richard Hull, Jianwen Su. Tools for Composite Web Services: A Short Overview.
3. Rania Khalaf, Nirmal Mukhi, Sanjiva Weerawarana. Service–Oriented Composition in BPEL4WS.
4. B. Lublinsky. Defining SOA as an architectural style. IBM Developworks, January 2007
5. Web Services Composite Application Framework (WS-CAF)
The link to the article doesn't seem right - is there a correction forthcoming?
Thanks Tom, I've fixed the link.
Hi there, I wonder what happens, if you use BPEL or any other orchestration technique when you need some glue code inbetween the service calls. Imagine for example a composed service from several navigation services, where some services return a partial route length in miles and some in kilometer. You don't want to introduce a service just for converting length, do you?
In the part : "Another possible approach to the implementation of composite services is event-based composition. This composition implementation is based on event-based service interactions: service consumers publish events to the publish/subscribe intermediary, which delivers them to the actual service CONSUMERS (Figure 6)." Maybe the correct would be : service consumers publish events to the publish/subscribe intermediary, which delivers them to the actual service PROVIDERS (Figure 6)." Thanks!
A good question. The article is about integration of the business services, not building business services. This is a common poin of confusion. If I understand the question correctly, you are building a business service, that uses multiple integration services (partial length calculation). In this scenario, I would never expose integration services, but only an overall service. Now you need to build the actual business service, that orchestrates partial integration ones. This is a different situation, where glue code might be the right solution. Also, when people talk BPEL, they typically talk macroflows. If you look, for example, at WPS implementation or WWF, the explicitely separate Macro and Microflows. In the latter case, the activity might be either service or SCA component (IBM). Such SCA component can be local java class (same EAR), which impose virtually no invocation overhead, This might be a good approach to building a service. Hope this helps.
You are absolutely correct. Stefan, can you, please, fix this
Hi Boris, I must admit, that I just don't un derstand your answer. I think the question is a good one. Just plugging services together "lego block style" seldom works. There is always a little custom work to do. I agree that a single service view should be exposed to the client, encapsulating the end service, but for me this is nothing other than EAI (enterprise application integration), where I produce a new service that so happens to call out to existing services. Is this what you mean?
What I was trying to say is that I differentiate two different scenarios: Orchestration of business services for building new solutions - topic of this article. In this case I do not care how business service is implemented and the fact that it internally uses multiple integration services is irrelevan at this point. Implementation of the business service, based on the integrations - the topic of the question. This two scenarios are quite different and follow different implementation rules.
A new article by I. Drobiazko and R. Zubairov introduces v. 5 of the Apache Tapestry component-oriented web framework. The tutorial shows how to create a component and covers IoC in Tapestry and Ajax.
In this interview, Burton Group consultant Pete Lacey talks to Stefan Tilkov about his disillusionment with SOAP, his opinion on REST, and addresses some of the perceived shortcomings REST vs. WS-*.
Jay Fields presents his concept of Business Natural Languages - a type of Domain Specific Languages geared towards being readable by domain experts.
Adoption and interest for Distributed Version Control Systems is constantly rising. We will introduce the concept of DVCS and have a look at 3 actors in the area: git, Mercurial and Bazaar.
Deborah Hartmann interviewed Segundo Velasquez about his experience as customer with an Agile team during the initial phase of software design of a product.
David Cooksey shows how to fine grained versioning to a ClickOnce deployment using an HttpHandler written with ASP.NET, making partial rollouts to a test audience much easier.
Windows workflow (WF) is an excellent framework for implementing business processes, but lacks support for human activities. This article describes a completely generic approach for changing this.
In this interview taken during OOPSLA 2007, Markus Voelter talks about the importance of documenting the software architecture, and gives some good and also bad examples on how it could be done.
8 comments
Reply