Question

I'm a bit puzzled about Zend Framework modules. I mean - I understand that you would usually want to have frontend and backend module... right?

But - What else would you separate out into modules?

can someone who uses Zend Framework professionally give an example of what modules they have in their application?

Was it helpful?

Solution

In the Zend MVC lingo a module is an independent part of your application. For example if you want to write a Content Management System you will probably have different modules like

  • Main application (user login, application bootstrap etc.)
  • Blog
  • News
  • Admin panel
  • Image gallery

Basically each of these modules could act as a separate application (although they will eventually be interconnected). The module approach also gives you an easy way for permission management (e.g. users can only pay for using certain modules).

OTHER TIPS

As addition to Daffs answers we could try to figure out some guidelines for deciding between choosing a 'controller' or a 'module' to implement a certain bundle of functionality. Please help making this list comprehensive by commenting or editing:

When to use a 'controller':

  • when there is a considerable degree of dependency on different models of the same module
  • when there is a considerable degree of interaction with other controllers of the same module
  • when the functionality can be covered with a few methods/actions
  • when the functionality is clearly just a bundle of subordinated functionality of the given module
  • when the functionality can be easily maintained together with the rest of the code (versioning, deployment, ...)

When to use a 'module':

  • when there are no or almost no dependencies with the main modules controllers and models
  • when the bundle of functionality can be seen as a separate (sub)application
  • when the functionality can't be covered with a few methods/actions and thus has to be broken down into several controllers
  • when versioning and deployment needs independence from main module
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top