DAO files in PHP needed?

0

I would like to know if DAO-type classes are required in PHP?

Ex: ProductoDAO

I see a lot of people programming without even putting DAO files on an MVC platform.

I'm learning Object Oriented programming in my college, and the teacher forwards the user to create DAO files for separation of responsibilities.

Hearing a @Hipster podcast, I noticed that the @stackoverflow developers put queries directly into the controller. Is that legal too?

    
asked by anonymous 25.10.2017 / 16:52

1 answer

2

A DAO is not connected to MVC nor pertaining to PHP , but you will commonly see the two being used together DAO and MVC and it is also common to see DAO in PHP by if it is a good practice. DAO is correct if related to a Pattern of the pattern.

DAO, as the name says, handles the connections of a model with its persistence, a DBMS such as PostgreSQL or even half text files for example, then it is common to be confused with the Controller, but it is wrong.

Here is an example link:

link

    
25.10.2017 / 17:37