use of repository design pattern RRS feed

  • Question

  • I m confused.. i want to know why do we use repostitory design pattern, i think it isolate DAL N BAL but How?am i right???

    Friday, May 11, 2012 5:58 AM


  • The following are the objectives


    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 within an entity.
    • You want to apply a domain model to simplify complex business logic.

    Did you have a look at http://msdn.microsoft.com/en-us/library/ff649690.aspx 

    • Proposed as answer by Mike FengModerator Monday, May 14, 2012 5:18 AM
    • Marked as answer by waqar100 Wednesday, May 16, 2012 9:30 AM
    Monday, May 14, 2012 4:57 AM