About registry and repository pattern... RRS feed

  • Question

  • User-301840979 posted

     the more i read about pattern the more i get confused!

    In particular i'm trying to get the relationship between Registry and Repository.

    Is it correct to say that a possible implementation of a Registry uses a Factory to return an appropriate Repository which, in turns, uses an underline DataMapper to performe the CRUD operations against a database?

    If no, which kind of relationship exists between repository and registry ?

    Tuesday, June 1, 2010 12:07 PM


  • User-1237044210 posted

    Hi liuc,           

    I really knew your problems. I also have some experiences about this. 

    So what is Registry pattern? Martin Powler is define it as below:

    "A Registry is essentially a global object, or at least it looks like one - even if it isn't as global as it may appear."

    In Structure Map, Jeremy Miller used Registry pattern for register all instances that you want to use on your application.

    And the Repository pattern is found by Eric Evans, and in his book Repository is abstract your persistence layer for persistence ignorance.

    I also used 2 patterns in my project at codeplex, you can see it at http://nma.codeplex.com/



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 1:19 PM