Repository Pattern vs DAL

后端 未结 12 2101
Happy的楠姐
Happy的楠姐 2020-12-02 04:05

Are they the same thing? Just finished to watch Rob Connery\'s Storefront tutorial and they seem to be similar techinques. I mean, when I implement a DAL object I have the G

12条回答
  •  一个人的身影
    2020-12-02 04:36

    A repository is a pattern that can be applied in many different ways, while the data access layer has a very clear responsibility: the DAL must know how to connect to your data storage to perform CRUD operations.

    A repository can be a DAL, but it can also sit in front of the DAL and act as a bridge between the business object layer and the data layer. Which implementation is used is going to vary from project to project.

提交回复
热议问题