Home » Php » php – Is ZF2 based on MOVE?

php – Is ZF2 based on MOVE?

Posted by: admin July 12, 2020 Leave a comment


I’m wondering if ZF2 is based entierly on MOVE instead of the classic MVC.

Somewhere I read that is really bases on MOVE (http://cirw.in/blog/time-to-move-on) but e.g. in the “getting started tutorial” (http://zf2.readthedocs.org/en/latest/user-guide/overview.html) they are saying “creating a simple database driven application using the Model-View-Controller paradigm”.

So, what is it now based on? Does it support both?

I’m a bit confused. What are the difference at MVC between ZF1 and ZF2?


How to&Answers:
MOVE (Models, Operations, Views and Events)
MVC (Models, Views, Controllers)

The problem with MVC is that you end up stuffing too much code into controllers,
to overcome this problem MOVE is another possible option to choose in zf2 projects,
Because in this architecture you can split your controller into Events and Operations.

Question: Is ZF2 based entirely on the MOVE architecture?

I don’t think ZF2 is designed entirely on MOVE architecture.
ZF2 follows the SOLID object oriented design principle with loosely coupled MVC architecture which provide more flexibility in terms of usability.

Question: Can I develop my projects using the MOVE architecture in ZF2?

Yes ZF2 provides you with everything to support both architectures (MOVE, MVC).
It provides Models, Views, Controllers(Operations), Events.
It is up to the developer which architecture he would like to use.

ZF1 and ZF2 is compared in another thread.


SOLID Object Oriented Programing


I am still a beginner in zf2, I am writing here since I had ported my zf1 code entirely to new zf2 framework. I could only say the new framework have lot of advantages and once you get certain new concepts and feature. you can save lot of time developing new project by reusing of modules/components etc.

In zf2 most of the library components are designed to be standalone, i.e loosely coupled, as said it gives more flexibility and a task can be done in many ways (just like PHP is). The main advantage I see is modules, I can split my project to many modules with ease and test individually and integrate very easily without any additional codes. Even I had all my resources like images, css and JavaScript files inside my module folders and access it without any problem (off course with a small code in index.php)

for me ZF1 has fixed rules, flows, etc, and zf2 have liberated flow and rules with new addition of events namespace, configuration and lazy loading, assemble objects, inject dependencies with servicemanger. in zf1 routes are automatic(programmatic), where as in zf2 we need route definition, in zf1 controllers are automatically choosen, where as in zf2 we need to define controllers as invokables, this are few things that take some time to get in once you get the idea you will feel the comfort of using the new zf2 framework

to start with you can do this steps

  1. Learn Service Manager
  2. How Configuration works
  3. How events work

Components wise more or less it works the same as in zf1 (at least in my case)

below are the following advantage I had benefited

  1. Full feel of OOP
  2. Modular application development
  3. Design and then develop to PHP application
  4. Web Application(RIA) platform