Back to list
Views:   0
Replies:  0
Archived
,
Reply 1
Yassin,

If you are talking about the Patterns In Action 4.0 MVC application, then it's there to provide a base implementation to the UI repositories.  The DoFactory guys can correct me if I'm wrong about this, but what this does in this particular pattern is provide a layer of abstraction in the UI for, what I see as three immediate reasons:

  1. WCF abstraction - the repository base abstracts away the actual implementation of the WCF proxy, so this way you aren't accessing it directly in the controllers.  The next reason explains why.
  2. Testability - by referencing repository interfaces instead of the WCF proxy client, you can now test your controllers, which in MVC is huge and necessary.
  3. DRY - Don't repeat yourself.  This class also provide access to a commonly used Correlate method that validates that your request and response matches.  You can also place other reusable methods here that help you process your code.
By designing the framework this way, they've given you access to WCF services and kept the controllers testable.  This is a "Win win".

I hope that answers your question.

King Wilder
King Wilder, Jan 07, 2011
Reply 2
I am not sure which context you are referring to, but as a general practice the "Generic Repository" interface should not be in the MVC application project.  It should be in a separate class library for ease of reuse and from maintenance point of view.
Rajesh Pillai, Jan 06, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas