views:

202

answers:

1

Both of them are based from mvc.

But in 3-tier architecture,storage layer is a separate layer,

while in symfony framework,database(storage) level is included in model layer.

Why are they different?

A: 

I would say that MVC is focused on user-interaction. It describes how to develop a rich and flexible system that reacts to user requests, but says nothing about what happens below controller layer.

It just says:

  • user sends a request;
  • dispatcher forwards request to appropriate controller;
  • controller retrieves models, but it's not specified HOW: using model's methods, using a DAO layer, using a Managers layer, whatever;
  • controller forwards to a view.

CakePHP also has model and data layer glued together, as many others. It's just a choice: this way you have less layers and less code, but in case you change your mind you'll have to modify all your code, directly in the models.

Megadix