Home > Backend Development > PHP Tutorial > 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
Release: 2016-08-04 09:20:58
Original
2480 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template