Posts

Showing posts from February, 2015

Repository Pattern

Repositorycommonly refers to a storage location, often for safety or preservation.
Objectives of using repository Use the Repository pattern to achieve one or more of the following objectives: You want to maximize the amount of code that can be tested with automation and to isolate the data layer to support unit testing.You access the data source from many locations and want to apply centrally managed, consistent access rules and logic.You want to implement and centralize a caching strategy for the data source.You want to improve the code's maintainability and readability by separating business logic from data or service access logic.You want to use business entities that are strongly typed so that you can identify problems at compile time instead of at run time.You want to associate a behavior with the related data. For example, you want to calculate fields or enforce complex relationships or business rules between the data elements …