views:

54

answers:

1

Hi, I have some questions regarding MVC that I would like to clarify. At our company we use two in-house developed frameworks for building PHP applications. One is an MVC framework while the other uses a 3-tier design with a presentation layer, a logic layer an a data access layer. We find the 3-tier design more "object oriented friendly". The question is if there is something we are missing in MVC, because we usually end up using the MVC framework for simple CMS systems and the other framework for more logic-intensive applications (like, for example an accounting application)

thanks

+1  A: 

That's somewhat comparing apples and oranges. There is no "versus". V and C in MVC are the presentation layer, whereas business logic and DAL is both layers in the M. As long as you keep these apart, there is no reason why your design cannot use MVC as well.

Gordon
Thanks for your answer. Maybe I didn't fully clarify my doubt: PHP MVC frameworks usually make use of arrays when returning data from storge, so my question should be if in those cases we have to have some kind of mapping between the arrays and the actual objects.
Nicolas
@Nicolas unfortunately that still has nothing to do with MVC as a pattern. Most Database Adapters, including those of MVC frameworks, can return objects and arrays. Whether you need a DataMapper or not depends on how closely your Domain objects map to the database structures (impedance mismatch) and which Domain Logic Pattern and Data Source Architectural Pattern you like to use. See http://martinfowler.com/eaaCatalog/index.html for an overview.
Gordon