Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to represent repository pattern in UML?

How to represent Repository pattern in UML?

Is there any stereotype that can be used to describe repository pattern? I am using Enterprise Architect to create diagrams. I specifically looking for class diagram representation.

like image 601
kaps Avatar asked Sep 09 '11 07:09

kaps


2 Answers

According to Martin Fowler, P of EAA, p. 322:

http://martinfowler.com/eaaCatalog/repository.html

(However, you must have already found this since it's the first hit on Google.)

Based on this example (and the text from P of EAA), this roughly translates to the following DCD:

enter image description here

like image 99
jensgram Avatar answered Oct 02 '22 03:10

jensgram


jensgram has already provided an answer on how to represent the pattern as classes.

When it comes to using patterns in EA, you can quite easily create them yourself using Save UML Pattern under the Diagram - Advanced menu. This saves an XML representation of the pattern.

You import the pattern for use in your project either using the Resources window or by creating an MDG Technology (more complex, but a much better alternative for medium and large-scale deployments).

Unfortunately, the one UML diagram type where EA does not support pattern creation is the sequence diagram.

like image 38
Uffe Avatar answered Oct 02 '22 01:10

Uffe