IT Bookworm Blog

Sep 20 2012   1:28PM GMT

Book excerpt: SOA with REST (part 1)



Posted by: Michael Tidmarsh
Tags:
Book excerpt
SOA

Book image via Shutterstock

This chapter is an excerpt from the new book, SOA with REST: Principles, Patterns & Constraints for Building Enterprise Solutions with REST, authored by Thomas Erl, Benjamin Carlyle, Cesare Pautasso, Raj Balasubramanian, published by Pearson/Prentice Hall Professional, August 2012, ISBN 0137012519, as part of the Prentice Hall Service Technology Series from Thomas Erl. For more info please visit the publisher page: www.informit.com/title/0137012519

We’ll be posting more from this book soon – and keep an eye out for a chance to win a free copy, courtesy of Pearson and ITKnowledgeExchange.

 

Analysis and Service Modeling with REST

A fundamental characteristic of SOA projects is that they emphasize the need for working toward a strategic target state that the delivery of each service is intended to support. In order to realize this, some level of increased up-front analysis effort is generally necessary. Therefore, a primary way in which SOA project delivery methodologies differ is in how they position and prioritize analysis-related phases. This consideration is equally relevant to any service implementation medium. In fact, the actual medium and associated technology that will be used to physically design and develop services may not actually be known during initial analysis stages. It may be better to determine whether REST or another medium is the most suitable choice after having had the opportunity to model a number of planned service candidates and study their anticipated composition and interaction requirements.

There are two primary analysis phases in a typical SOA project:

  • the analysis of individual services in relation to business process automation
  • the collective analysis of a service inventory

The service-oriented analysis phase is dedicated to producing conceptual service definitions (service candidates) as part of the functional decomposition of business process logic. The service inventory analysis establishes a cycle whereby the service-oriented analysis process is carried out iteratively to whatever extent the project methodology will allow.

9.1. Uniform Contract Modeling and REST Service Inventory Modeling

As explained in Chapter 4, a service inventory is a collection of services that are independently owned, governed, and standardized. When we apply the Uniform Contract {400} constraint during an SOA project, we typically do so for a specific service inventory. This is because a uniform contract will end up standardizing a number of aspects pertaining to service capability representation, data representation, message exchange, and message processing. The definition of a uniform contract is ideally performed in advance of individual REST service contract design because each REST service contract will be required to form dependencies on and operate within the scope of the features offered by its associated uniform contract.

Organizations that apply Enterprise Inventory [461] to build a single inventory of REST services will typically rely on a single over-arching uniform contract to establish baseline communication standards. Those that proceed with the Domain Inventory [458] approach instead will most likely need to define a separate uniform contract for each domain service inventory. Because domain service inventories tend to vary in terms of standardization and governance, separate uniform contracts can be created to accommodate these individual requirements. This is why uniform contract modeling can be part of the service inventory analysis project stage.

In the Service Inventory Analysis section from Chapter 8, we explained that the purpose of this stage is to enable a project team to first define the scope of a service inventory via the authoring of a service inventory blueprint. This specification is populated by the repeated execution of the service inventory analysis cycle. Once all (or as many iterations as are allowed) are completed, we have a set of service candidates that have been (hopefully) well-defined, individually and in relation to each other. The next step after that is to proceed with the design of the respective service contracts.

When we know in advance that we will be delivering these services using REST, it is beneficial to incorporate the modeling of the inventory’s uniform contract during the modeling of the service inventory itself. This is because as we perform each service-oriented analysis process and as we model and refine each service candidate and each service capability candidate, we gather more and more intelligence about the business automation requirements that are distinct to that service inventory. Some of this information will be relevant to how we define the methods and media types of the uniform contract.

For example:

  • understanding the types of information and documents that will need to be exchanged and processed can help define necessary media types
  • understanding the service models (entity, utility, task, etc.) in use by service candidates can help determine which available methods should be supported
  • understanding policies and rules that are required to regulate certain types of interaction can help determine when certain methods should not be used, or help define special features that may be required by some methods
  • understanding how service capability candidates may need to be composed can help determine suitable methods
  • understanding certain quality-of-service requirements (especially in relation to reliability, security, transactions, etc.) can help determine the need to support special features of methods, and may further help identify the need to issue a set of pre-defined messages that can be standardized as complex methods (as explained in Chapter 10)

A practical means of incorporating the task of uniform contract modeling as part of the service inventory analysis is to group it with the Define Technology Architecture step (Figure 9.1). It is during this step that general service inventory architecture characteristics and requirements are identified from the same types of intelligence we collect for the definition of uniform contract features. In this context, the uniform contract is essentially being defined as an extension to the standardized technology architecture for the service inventory.

Figure 9.1. The service inventory analysis cycle diagram from Chapter 8 augmented to include uniform contract modeling as an iterative task.

If combining the Model Uniform Contract task with the Define Technology Architecture step turns out to be an unsuitable grouping, then the Model Uniform Contract task can be positioned as its own step within the cycle.

When we begin working on the uniform contract definition, one of the key decisions will be to determine the sources to be used to populate its methods and media types. As a general starting point, we can look to the HTTP specification for an initial set of methods, and the IANA Media Type Registry for the initial media types. Further media types and possibly further methods may come from a variety of internal and external sources.

NOTE

It is also worth noting that methods and media types can be standardized independently of a service inventory. For example, HTTP methods are defined by the IETF. A service inventory that uses these methods will include a reference to the IETF specification as part of the service inventory uniform contract definition. Media types may be specified on an on-going basis by external bodies, such as the W3C, the IETF, and industry bodies across various supply chains, or even within an IT enterprise.

Before continuing, have a quick look at Figure 9.4 in the upcoming REST Service Modeling Process section. Note how the symbols for Steps 6 and 11 contain an asterisk in the top right corner. As explained in this section, this indicates that during this step we are modeling REST service candidates that either:

  • incorporate methods and/or media types already modeled for the uniform contract, or…
  • introduce the need to add or augment methods and/or media types for the uniform contract.

This type of two-way relationship between the Perform Service-Oriented Analysis step (which encompasses the REST service modeling process) and the Model Uniform Contract task is a natural dynamic of the service inventory analysis cycle.

NOTE

It is usually during the Model Uniform Contract task that a uniform contract profile is first populated with preliminary characteristics and properties. This profile document is then further refined as the uniform contract is physically designed and maintained over time.

 

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: