Skip to content

Commit eee932a

Browse files
committed
Added README.md description for Service Layer.
1 parent 9e1f6d1 commit eee932a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Structural patterns are concerned with how classes and objects are composed to f
3939
* [Service Locator](#service-locator)
4040
* [Servant](#servant)
4141
* [Event Aggregator](#event-aggregator)
42+
* [Service Layer](#service-layer)
4243

4344
### Behavioral Patterns
4445

@@ -494,6 +495,16 @@ A programming idiom is a means of expressing a recurring construct in one or mor
494495
**Real world examples:**
495496
* JPA annotations @OneToOne, @OneToMany, @ManyToOne, @ManyToMany and fetch = FetchType.LAZY
496497

498+
## <a name="service-layer">Service Layer</a> [&#8593;](#list-of-design-patterns)
499+
**Intent:** Service Layer is an abstraction over domain logic. Typically applications require multiple kinds of interfaces to the data
500+
they store and logic they implement: data loaders, user interfaces, integration gateways, and others. Despite their different purposes, these interfaces often need common interactions with the application to access and manipulate its data and invoke its business logic. The Service Layer fulfills this role.
501+
502+
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/service-layer/etc/service-layer.png "Service Layer")
503+
504+
**Applicability:** Use the Service Layer pattern when
505+
* you want to encapsulate domain logic under API
506+
* you need to implement multiple interfaces with common logic and data
507+
497508

498509

499510
# Frequently asked questions

0 commit comments

Comments
 (0)