Design Patterns Flashcards

1
Q

What is the repository design pattern?

A

To put it simply, it is an implementation of a brokering layer between the application and a data source. Neither party needs to be be aware of the other to perform their respective jobs which allows us to have a decoupled architecture which in turn helps in the scaling of the application in the big leagues without having hard dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the pro’s of the repository design pattern?

A
  • Separation of concerns; the application need not know about or track any or all data sources.
  • Allows easy unit testing as the repositories are bound to interfaces which are injected into classes at run time.
  • DRY (Dont Repeat Yourself) design, the code to query and fetch data from data source(s) is not repeated.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the negatives of the repository design pattern?

A

Adds another layer of abstraction which adds a certain level of complexity making it an overkill for small applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly