X Tutup
Skip to content

Commit 9040c8b

Browse files
committed
iluwatar#55 Added Repository description to README.md
1 parent a290c1a commit 9040c8b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ An architectural pattern is a general, reusable solution to a commonly occurring
8888
* [Data Access Object](#dao)
8989
* [Service Layer](#service-layer)
9090
* [Naked Objects](#naked-objects)
91+
* [Repository](#repository)
9192

9293
### Integration Patterns
9394

@@ -670,6 +671,20 @@ validation and for building to order
670671
**Real world examples:**
671672
* [Apache Struts](https://struts.apache.org/)
672673

674+
## <a name="repository">Repository</a> [&#8593;](#list-of-design-patterns)
675+
**Intent:** Repository layer is added between the domain and data mapping layers to isolate domain objects from details of the database access code and to minimize scattering and duplication of query code. The Repository pattern is especially useful in systems where number of domain classes is large or heavy querying is utilized.
676+
677+
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/repository/etc/repository.png "Repository")
678+
679+
**Applicability:** Use the Repository pattern when
680+
* the number of domain objects is large
681+
* you want to avoid duplication of query code
682+
* you want to keep the database querying code in single place
683+
* you have multiple data sources
684+
685+
**Real world examples:**
686+
* [Spring Data](http://projects.spring.io/spring-data/)
687+
673688

674689

675690
# Frequently asked questions

0 commit comments

Comments
 (0)
X Tutup