The active record pattern is an approach to accessing data in a database. A database table or view is wrapped into a class. Thus, an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save.
MVC is a framework for building web applications using a MVC (Model View Controller) design: The Model represents the application core (for instance a list of database records). The View displays the data (the database records).
In Factory pattern, we create object without exposing the creation logic to the client and refer to newly created object using a common interface.
What are the benefits of using MVC comparing to Active Record ?
In my website i used a combination of Active Record & Factory patterns. For me, it's more simple and faster to use these because i just need to write some functions. Also, i don't need a view, a model or something else. I mean in my opinion, the more i'm bounded to rules, the more designing becomes complicated.
But if what i say is correct, why there are too many frameworks that use MVC ?
Aucun commentaire:
Enregistrer un commentaire