Wednesday, May 28, 2014

Is it Suggested to Use Repository Pattern and Unit of Work with Entity Framework ( ORM Solutions)

Repository Pattern and Unit of Work Pattern on the top of Entity Framework an overhead from both performance and maintainability point of view. Unless otherwise there is strong business driver we should be stay away of this approach.

  1. Key Notes
    1. Repository adds little bit of testing enhancement at the cost of added performance and maintenance overhead.
    2. You should consider this approach only with Code First Approach.
    3. This allow you to change your ORM /Data Access layer in future but that is not very common case.
    4. Entity framework (ORM Solution) itself offer great capability to change underlying data source.
    5. Entity framework itself built on the top of Repository Pattern and Unit of Work Pattern so there is know point of adding another abstraction on the top.
    6. This approach was well in use during ADO.Net era not now getting obsolete with new ORM like data access solution.
  2. References 
    1. http://cockneycoder.wordpress.com/2013/04/07/why-entity-framework-renders-the-repository-pattern-obsolete/
    2. http://www.codeproject.com/Articles/688929/Repository-Pattern-and-Unit-of
    3. http://www.nogginbox.co.uk/blog/do-we-need-the-repository-pattern
    4. http://stackoverflow.com/questions/5762846/is-unitofwork-and-genericrepository-pattern-redundant-in-ef-4-1-code-first/5763551#5763551

5 comments:

  1. Thanks for sharing this scripts i had one doubt, how we can promulgate the frame works inside an website. Can you say about it ?

    Best Implant Clinic In Chennai | Best Laser Clinic In Chennai | Best Dental Clinic In Vellore

    ReplyDelete
  2. This blog is very well done as it is very much impressive for me to understand the concept so please say about those things in a very well detail manner.

    Web Design Company in Chennai

    ReplyDelete
  3. Very nice post here and thanks for latest smartphone applications it .I always like and such a super colors of phone for these post.Excellent and very cool idea and great models and different kinds of the more information's.

    AWS Training in Channai

    ReplyDelete
  4. Really Good article.provided a helpful information.keep updating...
    E-mail marketing company in india

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete