Bethel University Service Coupling Paper Chapter 7 – Service Coupling (Intra-Service and Consumer Dependencies)A minimum of 250 words and two scholarly sou
Bethel University Service Coupling Paper Chapter 7 – Service Coupling (Intra-Service and Consumer Dependencies)A minimum of 250 words and two scholarly sources.Since coupling is a natural and unavoidable part of service architecture, how can you avoid undesirable types of coupling? Give examples. 09_0132344823_07.qxd
6/13/07
4:49 PM
Page 163
Chapter 7
G
U
N
N
,
G
E
N
N
I
S
E
Service Coupling (Intra-Service
and Consumer Dependencies)
1
4
Profiling this Principle
1
Service Contract Coupling Types
7
T
Service Consumer Coupling Types
S
Service Loose Coupling and Service Design
7.1 Coupling Explained
7.2
7.3
7.4
7.5
7.6 Risks Associated with Service Loose Coupling
7.7 Case Study Example
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
6/13/07
4:49 PM
Page 164
W
hen assembling the pieces of a machine with nuts and bolts, you want to tighten
each part just the right amount. If you over-tighten one, you risk stripping the
bolt. If you don’t tighten it enough, the machine won’t be robust. Each tightened bolt
G
represents a coupling between two parts.
U
Along those same lines, we need to pay attention not just to where service coupling
N composition as well as the parts that
occurs, but the extent to which the parts of a service
N
comprise its individual services should be coupled.
,
7.1 Coupling Explained
G part of the IT vocabulary: Anything that
The term “coupling” is a pretty straight-forward
Eform dependencies on each other. Howconnects has coupling and coupled things can
ever, when we qualify coupling with “loose”N
or “tight,” we get into a more ambiguous
realm. Who’s to say what is considered more or less dependent? We will need a firm
N
understanding of how to measure and allocate appropriate levels of coupling (Figure
I Let’s therfore begin with a brief explo7.1) in order to effectively apply this principle.
ration of how coupling relates to automation S
environments in general.
Figure 7.1
This principle emphasizes the
reduction (“loosening”) of coupling
between the parts of a serviceoriented solution, especially when
compared to how applications have
traditionally been designed.
Specifically, loose coupling is
advocated between a service
contract and its consumers and
between a service contract and its
underlying implementation.
E
1
4
1
7
T
S
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
6/13/07
4:49 PM
Page 165
165
7.1 Coupling Explained
NOTE
In this chapter thicker arrow lines represent tighter coupling requirements.
Coupling in Abstract
Any part of an automation environment that’s separable has the potential (and usually
the need) to be coupled to something else for the sake of imparting its value. The root of
the term (couple) itself implies that two of G
something exist and have a relationship.
U
The most common way of explaining coupling is to compare it to dependency. A measN
ure of coupling between two things is equivalent
to the level of dependency that exists
between them. For example, the relationship
between
one software program and another
N
represents a measure of coupling associated
, with interoperability. Or the relationship a
technical contract has to the solution logic it is representing indicates a measure of coupling associated with the behind-the-scenes structure of the software program.
G
This also highlights the fact that the directionality of coupling can vary as well. Two
E integration channel may have formed a
applications tightly coupled by a point-to-point
N
bidirectional dependency in that each application
requires the existence (and perhaps
even the availability) of the other to function
properly.
Alternatively, unidirectional couN
pling is also common where one program may depend on another, but the reverse is not
I
true. The relationship between applications and databases, for example, is a common
S may depend on a database, but the dataform of unidirectional coupling (an application
E
base may not depend at all on the application).
Coupling is unavoidable. What we are most interested in when exploring coupling
1
within IT automation is how close this relationship
actually is or should be.
4
Origins of Software Coupling
1
In the past, many custom applications were
7 developed with certain types and levels of
coupling that were simply pre-set by the T
programming environments or surrounding
technology architectures. More often than not, coupling between software programs or
S
components was tight.
For example:
• In a traditional two-tier client-server architecture, the clients were developed
specifically to interact with a designated database (or specific process servers).
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
166
6/13/07
4:49 PM
Page 166
Chapter 7: Service Coupling (Intra-Service and Consumer Dependencies)
Proprietary commands were embedded within the client programs, and changes
to this binding affected all client installations.
• In a typical multi-tier component-based architecture, components were often
developed to work with other specific components. Even shared components that
became more popular after OO principles were applied still required tight levels of
coupling when made part of inheritance structures.
• When Web services emerged, they were often
G mistakenly perceived to automatically establish a looser form of coupling within
U distributed architectures. While
Web services can naturally decouple clients from proprietary technology, they can
N
just as easily couple client programs to many other service implementation details.
N
Interestingly, it is one of the earliest architectures that implemented a more loosely cou,
pled paradigm. Mainframe environments imposed
little dependencies on client terminals, allowing the same terminal to be used for multiple types of mainframe applications
(a loosely coupled client-server relationship that
G was later revived with the browser and
Web server).
E
However, while there is some conceptual commonality
in this comparison, it’s imporN
tant to point out that loose coupling is a very specific design characteristic that serviceN
orientation aims to establish across all services, especially throughout solution
I
back-ends. Even though mainframe environments
had loosely coupled workstation
S
clients, their server-side applications were monolithic
and self-contained. Because they
weren’t typically distributed, there was little emphasis
on
regulating back-end coupling.
E
Loose coupling, as a design concept, has historically been a greater part of commercial
software design. The use of drivers, for example,
1 allowed client programs to tightly bind
to the driver software, which, in turn, decoupled the client programs from underlying
4
hardware and system programs. Similarly, database connection protocols and associated software (such as ODBC and JDBC) also1introduce a loosely coupled relationship
between the client programs and underlying 7
database environments.
T programs in general highlights comThis past emphasis on reducing coupling between
mercial design as a primary influence of service-orientation,
as further discussed in
S
Chapters 8 and 9.
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
6/13/07
4:49 PM
Page 167
167
7.2 Profiling this Principle
SUMMARY OF KEY POINTS
• A level of coupling is comparable to a level of dependency.
• Software coupling simply represents a connection or relationship between two
programs or components.
• Many past architectural models established tightly coupled relationships
among their parts.
G
U
7.2 Profiling this Principle
N
Service coupling is a multi-faceted, dynamic
N design characteristic that ties into and
influences several other principles. On a fundamental level, this principle is concerned
,
with the relationship between a service, its underlying environment, and its consumers
(as previously illustrated in Figure 7.1).
G
As further detailed in Table 7.1, when trying to determine suitable levels of service coupling, our goal is to position the service asEa continually useful and accessible resource
while also protecting it and its consumers from
N forming any relationships that may constrain or inhibit them in the future (Figure N
7.2).
I
S
E
1
4
1
7
Figure 7.2
T
The fundamental impacts of coupling on the service and consumer. The constraints
Sthe measure of coupling and the quantity
expressed in this figure are amplified when
of consumers is increased.
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
6/14/07
168
8:09 AM
Page 168
Chapter 7: Service Coupling (Intra-Service and Consumer Dependencies)
NOTE
Because the scope of this chapter (and this book) is focused on service
design, we are only concerned with coupling issues internal to the service
architecture and between a service and its immediate consumers. There
are various architectural design options for reducing coupling levels via
the use of middleware and intermediaries. Some of these architectural
coupling issues are also addressed by design patterns.
Short Definition
Long Definition
G
Principle U
Profile
N
“Services are loosely coupled.”
N
“Service contracts,impose low consumer coupling requirements and are themselves decoupled from their surrounding
environment.”
Goals
Design
Characteristics
G
By consistently fostering
reduced coupling within and
E
between services we are working toward a state where
service contracts N
increase independence from their
implementationsN
and services are increasingly independent from each other. This promotes an environment in
I
which services and their consumers can be adaptively
evolved over time
Swith minimal impact on each other.
E
• The existence of a service contract that is ideally decou-
pled from technology and implementation details.
1
• A functional service context that is not dependent on
outside logic. 4
1 coupling requirements.
• Minimal consumer
7
Implementation
Requirements
• Loosely coupled services are typically required to perT
form more runtime processing than if they were more
tightly coupled.
SAs a result, data exchange in general
can consume more runtime resources, especially during concurrent access and high usage scenarios.
• To achieve the right balance of coupling, while also
supporting the other service-orientation principles that
affect contract design, requires increased service contract design proficiency.
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
6/13/07
4:49 PM
Page 169
169
7.3 Service Contract Coupling Types
Web Service Region
of Influence
As we explore different coupling types in the next section, it will become evident that applying this principle
touches numerous parts of the typical Web service architecture. However, the primary focal point, both for internal and consumer-related design considerations, remains
the service contract.
G
U
N
N
,
G
E
N
Figure 7.3
N
I
Table 7.1
A profile for the Service Loose Coupling principle.
S
E KEY POINTS
SUMMARY OF
• The scope of this principle affects both the design of a service, as well as its
relationship with consumer programs. 1
• While we are concerned with how coupling
4 affects service logic, the primary
emphasis is on the design of the service contract.
7.3
1
7
T
Service Contract Coupling Types
S
To gain a better appreciation of the extent to which coupling can become part of service
design, we need to take a look at the common types of relationships that need to be created within and outside of the service boundary.
This, the first of two sections that explores coupling types, is focused on dependencies
that originate from within the service. How these relate to and influence the service contract directly ties into the subsequent Service Consumer Coupling Types section that
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
170
6/13/07
4:49 PM
Page 170
Chapter 7: Service Coupling (Intra-Service and Consumer Dependencies)
explores how less desirable forms of intra-service coupling can make their way into consumer program designs.
The service contract is the core element around which most coupling-related design considerations revolve. The basis of these issues is the relationship between the service contract and whatever logic and resources it encapsulates. As shown in Figure 7.4, we can
design the contract with dependencies on the underlying service logic—or—we can
choose to design the service logic with dependencies on the service contract.
Figure 7.4
The illustrated forms of coupling are described in the
upcoming Contract-to-Logic Coupling and Logic-toContract Coupling sections.
G
U
N
N
,
G
E
N
N types and the impact of proceeding
Understanding these two fundamental coupling
I the design of individual services and
with either is key to identifying the link between
the direction in which an entire service inventory
S will ultimately evolve. The designtime dependencies established between a service contract and its underlying logic have
E
a direct bearing on the ultimate strategic potential of each service within a service inventory and, therefore, on the inventory as a whole.
1
Figure 7.5 positions the contract and its logic within the scope of common servicerelated dependencies that can exist as part of 4
a typical SOA. This perspective also highlights the potential design complexity introduced
1 by coupling-related issues.
7
T
S
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
6/13/07
4:49 PM
Page 171
171
7.3 Service Contract Coupling Types
G
U
N
N
,
G
E
N
N
I
S
E
1
4
1
7
Figure 7.5
Coupling is a natural and unavoidable part of service architecture.
It’s knowing how and when to adjust the extent
T
of coupling that gives us the ability to tune this architecture in support of service-orientation.
S
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
172
6/13/07
4:49 PM
Page 172
Chapter 7: Service Coupling (Intra-Service and Consumer Dependencies)
Various types of service-related coupling are represented in Figure 7.5, all of which can
relate to both the service logic and contract. The same coupling types are re-displayed
as part of a conceptual view in Figure 7.6.
G
U
N
N
,
G
E
N
N
I
S
E
1
4
1
Figure 7.6
Both service contract and service logic can form dependencies
7 on parts of the service environment and on
each other.
T
From the relationships and dependencies depicted
S in Figures 7.5 and 7.6 we can extract
a specific set of coupling types that are directly relevant to the design of services:
• Logic-to-Contract Coupling
• Contract-to-Logic Coupling
• Contract-to-Technology Coupling
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
6/13/07
4:49 PM
Page 173
173
7.3 Service Contract Coupling Types
• Contract-to-Implementation Coupling
• Contract-to-Functional Coupling
Except for logic-to-contract coupling, the goal behind this principle is to reduce the
extent of all these coupling types. The following sections explore each type in more
detail:
Gof service logic to the service contract)
Logic-to-Contract Coupling (the coupling
U is to design its physical contract prior to
A recommended approach to building a service
N first” process is very effective at ensuring
its underlying solution logic. This “contract
that contract design standards are consistently
N incorporated. It also allows us to tune the
underlying logic in support of the service contract, which can optimize runtime per,
formance and reliability.
Following the contract-first process can result in the service logic being tightly coupled
G
to the service contract (known as logic-to-contract coupling) because it is created specifiE contract, as shown in Figure 7.7.
cally in support of the independently designed
Figure 7.7
A Web service created through the contract-first
process will naturally result in the service logic
forming a tightly coupled relationship on the service
contract. The contract, though, is not really coupled
to the logic at all, allowing the service logic to be
replaced in the future without affecting service
consumers that have formed dependencies on
the contract.
N
N
I
S
E
1
4
1
7
T
Despite the tight, unidirectional dependency
S formed by the logic on the contract, this is
considered a positive type of coupling and a proven means of customizing services in
support of service-orientation. It is further supported through the application of the
Standardized Service Contract principle, which fundamentally preaches the contractfirst design approach.
SOA Principles of Service Design, First Edition, by Thomas Erl. Published by Prentice Hall. Copyright © 2008 by Pearson Education, Inc.
09_0132344823_07.qxd
174
6/13/07
4:49 PM
Page 174
Chapter 7: Service Coupling (Intra-Service and Consumer Dependencies)
Of course, controlling the amount of required coupling between contract and logic is
something we can only really accomplish when custom-developing services. In environments where service contracts need to be auto-generated or are provided by service
adapter extensions, the level of coupling is often predetermined. In these cases there
may be a need to resort to wrapper services, as further explored in the case study example at the end of this chapter.
G
FOR EXAMPLE
U
A multi-national pharmaceutical firm carried out a two-year SOA pilot program during
N 12 business processes within the
which 47 Web services were created to automate
human resources segment of the organization.N
A service design process was custom
tailored for this project requiring that each Web service contract be fully developed prior
,
to any further programming effort. Before the project could start, several of the programmers on the team had to undergo training in order to gain the required proficiency with
WSDL and XML schema.
G
The end result was a moderately sized serviceE
inventory wherein 85% of services
achieved high logic-to-contract coupling. Various capabilities within the remaining servN
ices were required to encapsulate legacy systems to one extent or another. This resulted
N coupling at all (or having mixed
in some service contracts having no logic-to-contract
levels of this coupling as implemented by a subset
I of the contract capabilities).
Note that in this project some legacy system encapsulation
restrictions were overcome
S
through the use of dedicated utility services that provided native translation of propriE
etary legacy APIs. (Specific design patterns exist to address legacy abstraction for
service inventories.)
1
4
Contract-to-Logic Coupling (the coupling of the service contract to its logic)
1
The previous section described a coupling type based on the customization of the serv7
ice contract prior to the development of the underlying
service logic. This positions the
contract as a relatively independent part of the
T service architecture, which maximizes
the freedom with which the service can be evolved
S over time.
However, many contracts for Web services in particular have been derived from existing solution logic. This reverses the coupling dynamic, in that once these types of contracts come into existence, they find themselves immediately dependent on the
underlying logic and implementation. As explained in Figure 7.8, thi…
Purchase answer to see full
attachment
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. Even if we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency. If you want a cheap essay, place your order in advance. Our prices start from $11 per page.