14

Many PHP frameworks claim that they implement MVC design pattern. However, in their implementation, the model and view don't know each other and each communication in between must be done through controller. As I read in wikipedia, this is MVA (Model View Adapter) instead of MVC design pattern approach because in MVC, model and view communicates directly.

Those frameworks' claim are wrong or did I miss something?

LeleDumbo
  • 9,192
  • 4
  • 24
  • 38
  • 3
    Really? I didn't know that, nice find. I always thought that it was like Models <- Controller -> Views for MVC. Maybe you're right.. – Jimmie Lin Jul 28 '11 at 06:52

1 Answers1

7

Frameworks like CodeIgniter are MVA, yes. However, their claims are not wrong since MVA is basically a different type of MVC deployment. Mediating controllers are hit by users which handle the business logic; they also call to the model to get the data and prepare the view.

This is not wholly diverged from strict MVC where the Model and View can talk to each other, so to say it's "wrong" is a bit harsh. I would say it's a different take on MVC.

EDIT:

See CodeIgniter's take on it:

https://www.codeigniter.com/user_guide/overview/at_a_glance.html#

Models are not required as everything can be done in the controller (not advised, obviously). Note that CI (and most other frameworks) say they are based on MVC principles.

Stack Programmer
  • 679
  • 6
  • 18
Michael B
  • 1,743
  • 4
  • 21
  • 35
  • Hmm... maybe you're right, other model-xxx-yyy wikipedia articles said that they're *based* on MVC. "Different view/take" might indeed be a better term. – LeleDumbo Jul 28 '11 at 08:59