The principles of service-orientation part 2 of 6: Service contracts and loose coupling [by Thomas Erl]

转载 2006年06月01日 15:14:00
 

In the previous article we established the service-orientation design paradigm as currently providing us with the following eight common principles:

• services share a formal contract

• services are loosely coupled

• services abstract underlying logic

• services are reusable

• services are composable

• services are discoverable

• services are autonomous

• services are stateless

These principles are "common" in that they represent an industry-level perspective of service-orientation as determined by research conducted by SOA Systems Inc. In part 2 of our series we dive into an exploration of these principles by discussing the first two on the list: the required use of service contracts and the creation of a relationship between services known as "loosely coupled."

The role of service contracts

Services are formally defined using one or more service description documents. In the Web services world, the technical service description documents are typically the WSDL definition and the XSD schema. A third type of document that will become increasingly important is the policy. Each of the these documents can be classified as service metadata, as each provides information about the service. Service description documents can be collectively viewed as establishing a service contract – a set of terms and conditions that must be met and accepted by a potential service requestor in order to enable successful communication and interaction. (Note that a service contract can also refer to additional non-technical documents or legal agreements, such as SLAs.) Within SOA, service contracts provide a formal definition of:

• the service endpoint

• each service operation

• every input and output message supported by each operation

• the data representation model of each message's contents

• rules and characteristics of the service and its operations

Service contracts therefore define a great deal of the underlying architecture of a solution environment, and may even provide semantic information that explains how services as part of this solution go about accomplishing a particular task. Either way, this information establishes the terms of engagement to which consumers of a service need to comply.

Because this contract is shared amongst services, its design is extremely important. Service requestors that agree to this contract can become dependent on its definition. Therefore, contracts need to be carefully maintained and versioned after their initial release.

Service contracts represent a cornerstone principle in service-orientation and therefore support or even enable other principles such as service abstraction, composability, discoverability and, our next item of discussion, loose coupling.

 

What it means to be loosely coupled

No one can predict how an IT environment will evolve. How automation solutions grow, integrate or are replaced over time can never be accurately planned out because the requirements that drive these changes are almost always external to the IT environment. Being able to ultimately respond to unforeseen changes in an efficient manner is a key goal of applying service-orientation. Realizing this form of agility is directly supported by establishing a loosely coupled relationship between services.

As with traditional distributed architectural models, SOA is based on the concept that solution logic is partitioned into multiple units of logic that can be assembled to collectively automate business tasks. One of the characteristics that distinguishes SOA from its predecessors is how these units of logic are required to relate to each other.

This is where the issue of coupling comes in. Coupling between software programs can be viewed as representing a measure of dependency. The higher the dependency, the tighter the coupling. No dependencies indicates a decoupled state. It is strongly encouraged that units of logic (services) within SOA minimize their respective dependencies to whatever extent possible. This specific relationship has been termed "loosely coupled" and it is accomplished by limiting the dependencies between a service and its requestors to the information expressed in the service contract – and – designing the service contract in such a way that it is not necessarily specific to any one service requestor.

By consistently implementing this principle, newly built services establish a notable independence from each other. This allows an organization standardizing on SOA to accumulate an inventory of services that exist as relatively standalone units of logic which can be configured into new compositions, as required. When creating multiple services in pursuit of establishing a service-oriented enterprise, these services can be categorized into specific service models. This allows them to become specialized in the type of logic they encapsulate. One increasingly important service model is the business service, which limits the logic a service represents to the accurate expression of a specific business context.

When standardizing on a set of service models, larger domains of an enterprise can be successfully abstracted. This effectively allows organizations to strategically establish loosely coupled relationships between specific areas of the enterprise by creating layers of services that represent the respective domains. In doing so, the benefits of loose coupling – most notably the increase in organizational agility it fosters – are amplified. This also demonstrates how service-orientation, as a paradigm, is not limited to the service-design level. Its principles can be broadly applied to areas throughout the enterprise.

What's next

In part 3 of this series we will move on to discuss two more principles on our list, one of which is service abstraction. We will extend our explanation of loose coupling to explore how abstraction ties into fostering organizational agility by allowing the underlying logic and technology encapsulated by services to evolve independently.

This article contains excerpts from "Service-Oriented Architecture: Concepts, Technology, and Design" by Thomas Erl (792 pages, Hardcover, ISBN: 0131858580, Prentice Hall/Pearson PTR, Copyright 2006). For more information, visit www.soabooks.com.

The principles of service-orientation part 1 of 6: Introduction to service-orientation [by Thomas Erl]

 This is the first article in a six-part series dedicated to exploring the common principles of serv...
  • Xalloy
  • Xalloy
  • 2006年06月01日 15:10
  • 1085

The principles of service-orientation part 3 of 6: Service abstraction and reuse [by Thomas Erl]

 An aspect of service-orientation that ties directly into our previous discussion of service contrac...
  • Xalloy
  • Xalloy
  • 2006年06月01日 15:15
  • 1070

The principles of service-orientation part 4 of 6: Service discoverability and composition [by Thomas Erl]

 Continuing our exploration of service-orientation, we now focus on two principles that tend to rece...
  • Xalloy
  • Xalloy
  • 2006年06月01日 15:17
  • 917

松耦合(Loose coupling)笔记

松耦合的目标是最小化依赖。松耦合这个概念主要用来处理可伸缩性、灵活性和容错这些需求。SOA应用于大型分布式系统。对于这样的系统来说,可伸缩性和容错性是可维护性的关键。另一个重要的目标是:最小化修改、故...
  • pan_tian
  • pan_tian
  • 2013年09月10日 16:09
  • 3078

Amazon Leadership Principles

Amazon Leadership Principles Whether you are an individual contributor or a manager...
  • besley
  • besley
  • 2012年11月22日 14:03
  • 1190

Business analysis and SOA part 2 of 6: Business service models and the entity-centric business service [by Thomas Erl]

 As part of the design of service-oriented solutions it is common to label individual services accor...
  • Xalloy
  • Xalloy
  • 2006年06月01日 15:23
  • 1243

laravel的提供者、容器、门面

1、laravel Container: Class Bar{ } Class Foo{ public function __construct(Bar $bar) { } } App...
  • jj546630576
  • jj546630576
  • 2018年02月03日 23:05
  • 7

Principles of Computing (Part 2) week 2 -- Recursion

The importance of Recursion Recursion methodology is to invoke itself to solve problem by changing ...
  • oasis_linbo
  • oasis_linbo
  • 2015年04月09日 19:24
  • 520

Business analysis and SOA part 1 of 6: The benefits of business services [by Thomas Erl]

 This is the first article in a six-part series dedicated to exploring how SOA and service-orientati...
  • Xalloy
  • Xalloy
  • 2006年06月01日 15:20
  • 1226

Business analysis and SOA part 3 of 6: Process-centric business services [by Thomas Erl]

 In the previous article we described the role of service models and explored the design standards f...
  • Xalloy
  • Xalloy
  • 2006年06月01日 15:24
  • 1503
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:The principles of service-orientation part 2 of 6: Service contracts and loose coupling [by Thomas Erl]
举报原因:
原因补充:

(最多只允许输入30个字)