filmov
tv
Laravel Repository Design Pattern | Laravel Advanced | Repository Pattern |
Показать описание
The repository design pattern allows you to use objects without having to know how these objects are persisted. Essentially it is an abstraction of the data layer.
This means that your business logic doesn’t need to know how data is retrieved or what the source of the data is. The business logic relies on the repository to retrieve the correct data.
A misconception that I see a lot regarding to this pattern is that repositories are being implemented in such a way to create or update records. This is not what a repository should do. Repositories shouldn’t create or update data, but should only be used to retrieve data.
This means that your business logic doesn’t need to know how data is retrieved or what the source of the data is. The business logic relies on the repository to retrieve the correct data.
A misconception that I see a lot regarding to this pattern is that repositories are being implemented in such a way to create or update records. This is not what a repository should do. Repositories shouldn’t create or update data, but should only be used to retrieve data.