jeudi 13 août 2015

Easy implementation of Repository Pattern

I am using ADO.NET directly with MVC 5 and not Entity Framework.

I am referring to this example to implement Repository Pattern.

For a simple implementation of Repository Pattern:

  1. I will create a Model
  2. I will create an interface with CRUD method declarations
  3. I will create a class in Data Access Layer which will implement the above interface and will have CRUD method implementations

I want to know why Interface is used? Can I not directly use a class, as per point (3) above.

What is the role of interface?

As per the above three points mentioned, is it the correct implementation of Repository Pattern?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire