Within the
service-orientation Service-orientation is a design paradigm for computer software in the form of services. The principles of service-oriented design stress the separation of concerns in the software. Applying service-orientation results in units of software partiti ...
design paradigm
A design is a plan or specification for the construction of an object or system or for the implementation of an activity or process or the result of that plan or specification in the form of a prototype, product, or process. The verb ''to design'' ...
, Service Refactoring is a
design pattern
A design pattern is the re-usable form of a solution to a design problem. The idea was introduced by the architect Christopher Alexander and has been adapted for various other disciplines, particularly software engineering. The " Gang of Four" b ...
, which is applied to an existing service
so that either the service logic or its implementation can be changed without affecting the service consumers.
Rationale
It is natural for a service to undergo changes for various reasons. The change could be required because the underlying implementation e.g. databases,
legacy system
In computing, a legacy system is an old method, technology, computer system, or application program, "of, relating to, or being a previous or outdated computer system", yet still in use. Often referencing a system as "legacy" means that it paved ...
s, etc. needs to be upgraded or simply because the original service logic was not making efficient use of memory. In other cases, the change could be initiated by the service consumers themselves. For example, with limited concurrent usage, the service performs as stated in its
SLA, however, with an increase in its concurrent usage, the service is unable to fulfill its SLA, consequently the service needs to respond to the increasing performance demands from its service consumers.
[Jason Bloomber]
The Four Pillars of Service-Oriented Development
nline Date accessed: 27 April 2010.
This situation needs to be dealt with in a manner so that the service is upgraded without affecting its consumers that have already formed dependencies on the service. Although one could argue that responding to any of the aforementioned requirements should not be problematic as long as the service honors its contract. However, we are concerned with both the outcome from the execution of service capabilities
and also with the behavior and reliability of the service. The Service Refactoring design pattern provides a strategy that strives to ensure a service can evolve without negatively affecting its consumers.
Thomas Erl
Thomas Erl (born 1967) is a Canadian author, and public speaker known for major contributions to the field of service-oriented architecture. Author of eight books on Service Orientation, Erl defined eight widely accepted principles of service ...
br>Introducing SOA Design Patterns
nline Date accessed: 5 April 2010.
Usage
The application of this design pattern advocates the use of traditional
software refactoring techniques. The focus is on refactoring the service in smaller steps so that the impact of each step is small enough to the reversed in case such a change negatively affects the service consumers. Secondly, to ensure the service contract remains unaffected by changes in logic or implementation, the service contract must be decoupled as much as possible.
[Wajid Khatta]
Service Refactoring
nline Date accessed: 27 April 2010. This can be done by introducing a façade component
between the service contract and the service logic. However, this is only possible if the service contract is physically decoupled from its implementation in the first place, which could be accomplished by the application of the Decoupled Contract
[Decoupled Contract design pattern](_blank)
/ref> design pattern. This could further be strengthened by the application of the Contract Centralization design pattern that advocates establishing the service’s contract as the only official entry point into the service.
On the other hand, to insulate service logic from negative effects from changes in the service implementation, the Service Façade design pattern could be reapplied to introduce another façade component between the service implementation and the service logic. The application of the Service Abstraction Service abstraction is a design principle that is applied within the service-orientation design paradigm so that the information published in a service contract is limited to what is required to effectively utilize the service The service contract s ...
principle can further help to reduce the possibilities of any detrimental effects caused by the application of this design pattern.[Dennis Wisnosk]
Principles and Patterns at the U.S. Department of Defense
nline Date accessed: 28 April 2010.
Considerations
The application of the Service Refactoring design pattern requires extensive testing to ensure a reliable and proven service, although inefficient, carries on the same level of behavioral stability and reliability. This might increase the project costs and would require additional quality assurance procedures and strict governance.
On the other hand, with its application, there might be a change to the current abstraction levels of the service, which would in turn require reapplication of the Service Abstraction design principle to ensure the service maintains the right level of abstraction. In some situations it might be impossible to constrain the effect of changes in the service logic or its implementation, and inadvertently the service contract must be updated. In this case, the Concurrent Contracts design pattern could be applied so that the service continues to entertain its consumers that have formed dependencies on its old contract while at the same time providing the updated contract that is in line with the updated service logic or service implementation.
References
Further reading
* Erl Erl or ERL may refer to:
People
* Elli Erl (born 1979), German musician
* Hans Erl (1882–1942?), German operatic bass
* Sebastian Erl, German singer
* Thomas Erl (born 1967), Canadian author
Transport
* ERL (automobile manufacturer), a def ...
et al.,(2009
SOA Design Patterns
Prentice Hall. {{ISBN, 0-13-613516-1.
* Mauro. et al
Service Oriented Device Integration - An Analysis of SOA Design Patterns.
nline pp. 1–10, 2010 43rd Hawaii International Conference on System Sciences, 2010. Date accessed: 5 April 2010.
External links
SOA Concepts
SOA Terms Glossary
SOA patterns
Service-oriented (business computing)