0
I wonder if DAO classes are required in PHP?
Ex: Productodao
I see many people programming without putting same DAO files on a MVC platform.
I am learning Object-Oriented programming at my college, and the teacher directs the user to create DAO files for separation of responsibilities.
Listening to a @Hipster podcast, I noticed that the developers of @stackoverflow put querys right into the controller. That’s also cool?
Related: How the DAO Standard works?.
– rray
@rray I read this post. Despite being almost the same thing, I funnelled the issue focusing on PHP.
– Thiago Cunha
When we bring the concepts of good practice to the community, what can we find by surprise? We know that a large part of the PHP community still has bad practice. And I don’t know if that’s right, because I’ve come across a lot of systems in a large company, and I find a lot of things that I don’t believe in!
– Thiago Cunha
The concept of DAO is language dependent, the answer in Java will be the same for PHP. "Principles" in theory are state-of-the-art. However, it is not the same thing in practice. You will find wrong things in small, medium and large companies.
– Gabriel Heming
If you do not put the database access logic in a dao it is likely to put in a model :). The idea is to centralize these operations in a class if you put them right into the controller and it’s difficult to reuse and spread this code throughout the application. In the cast it also says that this solution is adopted by performace since abstractions have a cost (it may be a little too much).
– rray