Home  >  Article  >  Backend Development  >  Does Laravel no longer need the Dao and Service layers, and only needs a Model?

Does Laravel no longer need the Dao and Service layers, and only needs a Model?

WBOY
WBOYOriginal
2016-08-04 09:20:582392browse

I was learning Laravel and found that Laravel directly uses the Model to query the database data and return it. Does that mean: Laravel does not need the Dao and Service layers, and only needs a Model?

Reply content:

I was learning Laravel and found that Laravel directly uses the Model to query the database data and return it. Does that mean: Laravel does not need the Dao and Service layers, and only needs a Model?

Laravel’s ORM adopts the ActiveRecord mode, which can be basically divided into the following three layers: upper, middle and lower. Among them, the DB layer should be the DAO layer in the traditional sense. It is also often used in actual projects. To this level:

ORMlayer

DBlayer

PDOlayer

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn