vendredi 30 janvier 2015

How to implement the repository pattern for an app that will change its database from sql to nosql on in couple of years?


I have been reading a lot about repository implementation. I am confused about which way to implement it for a project I am sure would change its data layer methods because of db migration from MS Sql Server to NoSQL in a couple of years.


Imp #1



  • Implement Rep layer as a completely separate layer. This will have its own interface and conversion methods here. This rep layer has a dependency on DAL and in turn BLL will have a dependency on this layer


Imp#2



  • Implement Repository not as a separate layer but have its interfaces in Business Logic Layer and the methods in DAL.


I am leaning more towards imp #1 since it looks cleaner. However some explanations of experts I have read use imp#2. I think there must be a clear reason to use one over another according to the situation. I would ideally want our switch to a different database be as painless as possible.





Aucun commentaire:

Enregistrer un commentaire