0

I'm trying to implement a business logic layer with a few use case for saving data of Booking of a Vehicle. I'm a bit confused as to where the Repository pattern should be implemented. Should I use it in BLL or DAL? It sounds very basic but I'm kind of lost in the design phase. If Repository pattern is not suitable for BLL, then which one is. Any help/tips are appreciated.

4

1 回答 1

6

存储库模式的职责是存储和从数据层获取数据,并对数据层的外观进行抽象。其背后的想法是,如果该底层应该更改,您可能需要更改存储库的实现,但不需要更改仍会看到相同界面的存储库用户。
特别要记住 SOLID 设计规则和单一职责,存储库不应该有任何业务逻辑,因此不能成为其中的一部分。不过,业务层使用存储库。

于 2015-05-31T12:20:36.337 回答