mercredi 15 juin 2016

repository pattern variations?

Based on the following url, a repository pattern is basically a layer of repository objects that are used to encapsulate data access:

http://ift.tt/HEyrEs

For example, a UserRepository object would have a GetUsers() method like this

public User GetUsers()
{
   return context.Users;
}

Is that all there is to the Repository pattern or is there more to it? Are there any named variations of this pattern? For example, I think I encountered someone in the past who asserted that this pattern involved generic/dynamic CRUD for entities. For example, since CRUD is a fundamental and repeatable pattern a repository pattern would provide CRUD functionality dynamically for any/all entities. I guess something like this: new Repository().Read(). Is there a name for this variation of the Repository pattern?

Aucun commentaire:

Enregistrer un commentaire