2

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

0

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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 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 martinfowler.com/eaaCatalog/index.html for an overview.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.