The first article in this series, "Reusable assets, recipes, and patterns" introduced a recipe as a way to provide prescriptive guidance to create SOA implementations using patterns and a layered architecture. This recipe was called the SOA service implementation and optimize recipe. In this second article we examine this recipe in detail and explore the other reusable assets that it refers to. It should be noted that this recipe is by no means complete; rather, we use it to give a flavor of what is possible.
In the previous article we set up an IBM® Rational® Software Architect client to connect to the IBM Rational developerWorks RAS repository and imported the SOA service implementation and optimize recipe. This particular pattern recipe uses SOA patterns to implement and optimize services. The primary audience is architects and developers in an effort to provide prescriptive guidance in the development of a SOA application.
We use this recipe with a reference example to show how the recipe can be used. The recipe assumes a model-driven development environment, as provided by Rational Software Architect. The recipe also assumes the Rational Unified Process as an approach which implies a use-case-centric approach, including iterative envelopment and visual model.
We introduce the SOA implement and optimize services recipe first and the reference example, to show how the recipe can be applied to the reference example. The reference example uses a model-driven development approach and leverages the modeling capabilities of Rational Software Architect to develop a use case model, analysis model, design models and services models.
Implementation and optimization of services recipe
In the previous article we imported the SOA implementation and optimization of services recipe into Rational Software Architect. This particular recipe deals with how to apply and use a series of SOA patterns. The non-functional requirement of the system, such as performance scalability, interoperability can be used to determine which patterns are to be used. These non-functional requirements provide guidance on proper usage. This recipe is for architects and developers to provide prescriptive guidance in the development of a SOA application.
The recipe has two broad guidelines:
- Selecting implementation options
- Applying patterns to a service implementation
In this article we examine in detail the selecting implementation options. This will lay the foundation for the future series of articles where we will apply patterns to a service implementation.
Selecting implementation options
As the name implies, the recipe deals with two types of services:
- A green fields service: Typically, the service definition is known, perhaps through some business service analysis initiative. The recipe will also encourage the architect or developer to seek out previous implementations of services with similar non-functional requirements. This is to insure that the current implementation will have architectural consistency with the best practices of previous implementations.
- A service where a legacy application or service already exists. Typically, this is a legacy service or application and is immutable from the point of view of the developer or architect. This represents the vast majority of legacy applications or services that currently exist and need to be leveraged as part of larger SOA engagements. The non-functional requirements for the service must now be satisfied and this typically involves scalability and performance issues.
Figure 1, a diagram for the implementation and optimizing a service recipe, shows the sequence an architect follows to evaluate user requirements for use cases, as well as functional and non-functional requirements for the implementation and optimization of services.
Figure 1. SOA implementation and optimization of services recipe outline

This recipe assumes a model-driven development (MDD) approach and allows the modeler or architect to focus on different levels of abstraction to better architect the solution.
It is in the nature of the recipe to call out to richer sources of information where possible and since we are developing a SOA solution using a MDD approach, the first call of the recipe is to link to Rational Unified Process for SOA. The Rational Unified Process provides software development process guidance that has been distilled from the best practices of numerous developments.
The recipe shows that the use case is first analyzed to determine which of the use cases need to be built and which can leverage existing legacy services or applications.
- In the case of an existing application, the non-functional requirements (NFRs) are analyzed and the appropriate patterns applied based on those NFRs.
- In the case of services that need to be built, previous service implementations are analyzed for architectural consistency.
In both cases the service model and entity models, where available, are analyzed. In a MDD environment like Rational Software Architect these models will be Rational Software Architect models that are provided as part of the base install, and will follow the RUP in terms of their user experience. The recipe assumes n-tier architecture similar to that shown in Figure 2, where the SOA IF Patterns can be applied at the appropriate tiers.
Before giving an overview of the SOA patterns it is helpful to think of an n-tier architecture as outlined below. A simple three-tier architecture will have a presentation tier, a business tier and and persistence tier. In a SOA environment we can break the business tier further into a service layer, a controller layer, and an entity/object management layer. This layering is shown in Figure 2. The core Enterprise JavaBean™ patterns such as the session facade, message facade, and the business delegate belong in the controller tier.
The SOA patterns used by the recipe are relevant to the business tier. All of these patterns were harvested from strategic IBM SOA engagements. Each one of these patterns was developed as a pattern specification and a pattern implementation using the Rational Software Architect pattern engine. See the Resources section for more information.
When we talk about patterns -- and let's use the Gang of Four "Design Patterns" as an example -- there are two different elements that people are interested in. One is the actual text that describes the pattern. This is what you would find in the book, say in the chapter on the adapter pattern.
Then there are the design tooling elements that implement that pattern. For instance, there are UML artifacts in Rational Software Architect that implement the different design patterns from the Gang of Four book. So, if you wanted to apply an adapter to one of your designs, you'd pull that element off the palette and make some manipulations in the tool to actually transform your design to use the pattern.
The first thing we've called a "pattern specification". The second thing we've called a "pattern implementation". The coming articles of this series we will cover these patterns in much more detail.
The following four patterns will be considered; they will be examined in greater detail in future articles in this series:
- The WS Response Template Pattern (see Resources for the pattern specification) provides fine-grained access to a coarse-gained service and also provides flexibility in the service definition
- The Requester Side Caching Pattern (see Resources for the pattern specification) provides request side caching capabilities
- The Preferred Data Source Pattern is a microflow pattern for service aggregation
- The Aspects Patterns combine aspects, AJDT and Model Driven Development
Figure 2: N-tier Architecture

This type of elaboration of the business tier has many benefits:
- Decoupling the service definition from the business logic (controller) and from access to the data (entity) ensures that no business logic manifests itself in the entities.
- In a Web service implementation, the services can delegate to the controller for proper separation of concerns. The service is concerned only with the interception of the messages, but delegates to the controller to see that the business is done
- The controller implements the service business logic by accessing other services or accessing backend entities via their create, read, update and delete (CRUD) operations
- Now appropriate patterns can be applied at each layer to satisfy the non-functional and system requirements, and to produce architecturally consistent applications and services
In an effort to help the architect or developer to better understand this recipe, an example is also included.
The example has been integrated into the SOA implementation and optimization of services recipe for illustration purposes. In this section we step through the recipe to access assets that are used to construct the reference example. To do this we first need to set up a project in Rational Software Architect that can hold these assets. Typically these assets will be use case, services, analysis and design models. To create a simple project in Rational Software Architect, you can use this: File > Project > Simple > project call the project "Retail".
The example demonstrates how the SOA patterns work together in a composible manner and how they might interact with other patterns. This example is loosely based on a retail chain and focuses on a business service called 'Lookup Item'. Lookup Item would typically be used in a retail scenario where an item would need to be looked up in an inventory system before it could be sold. Typically 'Lookup item' is an example of a coarse-grained business service where we want to understand the corresponding IT services necessary to provision this business service.
Figure 3. Lookup item business service

Business process decomposition helps to better understand the complex process used to provision this business service. Figure 4 shows the intricacies of this business process. Two other services are used there, the catalog and inventory services.
- The catalog service is used to find the part number, or SKU, of the item that is to be looked up.
- The inventory service uses this SKU to see if the item is present in the inventory system. It first looks in a local inventory system. Failing this it will search in a warehouse inventory. The process could be continued by searching an outside supplier etc. We see this in more detail in Figure 4:
Figure 4. Lookup item business process decomposition

Business process decomposition separates business services from business processes. A business analyst can now think in terms of a lookup item service that would be part of some overall business process without having to understand the intricacies of the service implementation. Business process decomposition also helps understand the IT services that are necessary to provision this process and its services.
This use case model is stored as a reusable asset specification (RAS) asset on the dW RAS repository and can be accessed from the recipe. Figure 5 shows how to access and import the use case model from the recipe. Make sure to import the use case model into the Retail project previously created.
Figure 5. Importing the use case model asset from the recipe

A use case model helps the architect or developer understand the software artifacts and service that need to be built. The use case model shown in Figure 6 is very similar to the business process model in Figure 3. In this example, there is close mapping between the business service and the IT service, but that is not always the case. The use case model shows the lookup item from an IT perspective
Figure 6. Lookup item use case model

In this case there is a one-to-one mapping between the business services and the IT service. This is not always the case. It is a common and dangerous misconception that IT services and business services are one and the same. There are two IT services that are of interest to the SOA pattern reference architecture. These are:
- The catalog service looks up the item number in the parts catalog
- The inventory service finds the number of those items in stock according to the inventory system.
The architect determines which use cases can be implemented by pre-existing applications or services and which use cases need to be constructed or extended. In the SOA pattern reference example there is a pre-existing catalog application that exposes a Java interface. The inventory system needs to be composed of a series of calls to existing backend databases, such as a local store database and a central warehouse database. In the next section the service definitions of each of these use case are reviewed in more detail from a UML and WSDL viewpoint.
There are a two routes to arrive at a service model. This is not an "either/or" issue, there are times when one approach is more appropriate. Let's look at these in more detail:
- Top-down approach: In a top-down approach, such as IBM Service Oriented Modeling Approach (SOMA), services are identified and prioritized using business analysis. Details of the services are determined from business process models. An example of a rich set of domain-specific models (such as business process models, business object models) for the insurance industry is IBM Insurance Application Architecture (See the sidebar.) Details of the services are determined from business process models.The WSDL that describes the IT services is generated from a business process model that is created in a tool such as WebSphere® Business Integration Modeler.
- Bottom-up approach: In a bottom-up approach the services are defined using knowledge of the existing application packages and their interfaces together with a process choreography approach to create composite services. WSDL for these services is frequently generated from class models.
This inventory service model, which contains both the catalog service and the inventory lookup service, is stored as a RAS asset on the dW RAS repository and can be accessed from the recipe. Browse the recipe to the location shown below and import the Ref Example Asset: SOA Inventory Service model into the Rational Software Architect Project Retail created earlier. The catalog service can be accessed from the recipe, as shown in the following:
Figure 7. SOA Inventory Design Model RAS Asset

The catalog service looks up the item numbers -- stock keeping units or SKUs -- in the parts catalog. In model driven development, services are UML models class models with the UML 2.0 Profile for Software Services applied. The UML 2.0 Profile for Software Services provides a common language for describing a model of services.
The UML 2.0 Profile for Software Services provides a common language for describing services, one which covers a number of activities through the development lifecycle and also provides views to different stakeholders. The UML profile for software services is a profile for UML 2.0 which allows for the modeling of services, SOA, and service-oriented solutions. The profile has been implemented in IBM Rational Software Architect, used successfully in developing models of complex customer scenarios, and used to help educate people about the concerns relevant to developing service-oriented solutions (see Resources).
We now have a model for a detailed representation of how the service will be physically implemented. Using such a model, application and architectural patterns can be applied to satisfy the relevant non-functional requirements for performance, scalability and the like. The catalog service example uses patterns such as the WS Response Template pattern (see Resources) and security patterns. From the catalog service model, UML to WSDL transformations and a UML to XSD transformation can be applied to create the WSDL and XSD representations of the service, providing two different and complementary ways to visualize the service at different levels of abstraction. The transformations are beyond the scope of this article but will be included in the next article on the WS response template pattern.
- The catalog service UML model: catalog service (See below)
- The catalog service specification (WSDL): catalog service WSDL
Figure 8 shows the catalog service model. The model has two operations:
- The
getCatalog()operation takes a primary key and returnsCatalog - The
getCatalogs()operation takes an array of primary keys and returns an array ofCatalogs
Figure 8. Catalog service UML model

Figure 9 shows the catalog message model. The following is self-evident from this model:
- Each
Catalogmessage contains multipleCatalogItemmessages - Each
CatalogItemmessage contains multipleFeatureValuemessages - Each
FeatureValuemessage contains oneFeaturemessages
Figure 9. Catalog message UML model

The inventory service provides two operations. First, a query determines if the inventory contains enough units of an item to meet the quantity needed for an order. In the retail industry, the number of items available in stock is called the quantity on hand or QoH. The second operation records a change in inventory levels, either because an item had been sold or new stock has arrived: this is called a stock movement. This service can also be visualized at two different levels of abstraction, similar to the catalog service above.
- The inventory service UML model: inventory service
- The inventory service specification (WSDL)
Figure 10 shows the inventory service model. Following on the service description above, the model has two operations:
- The
getQoH()operation takes aQoHRequestand returnsQoHResponse - The
inventoryMovement()operation takes anIntegerand returns aBoolean
Figure 10. inventory service UML model

The inventory data model allows the request to specify the location of a source of inventory to be specified. An example might be a store or regional warehouse.
Figure 11. Inventory data UML model

Identification of legacy applications
Legacy catalog application design model
The reference example legacy catalog application design model can be accessed from the SOA implementation and optimization of service recipe in a similar manner to the way the SOA inventory service model and the SOA inventory use case model were imported into Rational Software Architect.
Figure 12. Accessing the legacy catalog application design model

Figure 13 shows the UML class diagram of the legacy catalog application. This application is a Java™ component and exposes a Java interface. The getCatalog() and getCatalogs() operations are very coarse-grained since they return an entire catalog and a list of catalogs respectively.
Figure 13. UML class diagram of the legacy catalog application

In the first article in this series, we introduced the use of Rational Software Architect as a RAS client to retrieve reusable assets in the form of a recipe. This article expands on this approach to demonstrate how services may be produced using these recipes, and how we may use patterns to construct those services to met specific non-functional requirements.
Services may be identified either through a top-down business analysis approach when constructing a green fields solution, or with a bottom-up approach when SOA is used for legacy system transformation.
To illustrate how patterns can be applied during service construction, we use a reference service example which is downloadable as a RAS asset: this reference example is bundled with the SOA implementation and optimization of services recipe as a step-by-step guide to using the recipe.
The next article in this series will show how to apply the WS Response Template pattern to the Catalog Service model (see Resources) to produce a more flexible and client-friendly interface.
Learn
- Learn more about the OMG standard for Reusable Asset Specification, version 2.2.
- Read "Model Structure Guidelines for Rational Software Modeler and Rational Software Architect" (developerWorks, March 2006) for more information on modeling in Rational Software Architect and Rational Softwar Modeler.
- The article,
"Web services response template pattern: a specification" (developerWorks, February 2006) examines the WSRT pattern specification and the solutions it offers to improve service interfaces.
- The article "The requester side caching pattern specification: An overview" (developerWorks, October 2005) examines the requester side caching pattern specification in detail.
- The article "Service modeling profile" (developerWorks, April 2005) describes the UML profile for software services, a profile for UML 2.0 which allows for the modeling of services, SOA, and service-oriented solutions.
- The article "Developing a J2EE Architecture with Rational Software Architect Using the Rational Unified Process " (devdeloperWorks, August 2005) shows how you can use IBM Rational Software Architect to define a software architecture.
-
Learn more about IBM Insurance Application Architecture.
-
Download an electronic version of the IBM Insurance Application Architecture poster.
-
Visit the developerWorks
SOA and Web services zone to learn more and expand your skills.
-
Read about the IBM Enterprise Integration Solutions team, who offer technical and engagement leadership for SOA and Advanced Web Services.
-
Learn more about IBM Insurance Application Architecture.
-
Stay current with
developerWorks
technical events and Webcasts.
Get products and technologies
-
Download a free trial version of Rational RequisitePro V2003.06.15.
- Check out the RUP for SOA Plug-In V1.0.
-
Download a trial version of Rational Software Architect V6.0 for no charge.
-
Build your next development project with
IBM
trial software, available for download directly from developerWorks.
-
IBM Alphaworks provides a reference implementation of the RAS called
Reusable Asset Specification Repository for Workgroups, this reference implementation is available for download directly from alphaWorks.
-
Find out more about The Reuseable Asset (RAS) Repository.
-
Get your hands on application development tools and middleware products from DB2®, Lotus®, Rational®, Tivoli®, and WebSphere®. You can download evaluation versions of the products at no charge, or select the Linux® or Windows® version of developerWorks' no-charge Software Evaluation Kit.
Discuss
-
Participate in developerWorks
blogs and get involved in the developerWorks community.
Clive Gee is an executive consultant with nearly 30 years experience in the IT industry. For the past three years he has been focusing on SOA, particularly aspects of the services development process and its governance
Dr. Eoin Lane, Senior Solution Engineer, is the lead for harvesting and developing of application pattern from key IBM SOA engagements and driving those patterns through IBM pattern governance process to accelerate adoption. Eoin also specializes in Model Driven Development (MDD), asset based development and Reusable Asset Specification (RAS) to facilitate SOA development.
Comments (Undergoing maintenance)





