Hello,

 

The whole time I'm playing with ZF, I'm wondering, why everybody, while
mentioning modular application, sticks the admininstration functionality to
a single module, called "admin". I fail to see, how such step is compatible
with the idea "modular". Could someone, please, help me to understand?

 

Let's say we have three modules, "members", "content" and "admin". Members
module allows vistitors to register on the website and the content displays
a regular dynamic text page. Now, we need to accept new members and modify
the text page manually. By my thinking, such functionality should be placed
in the "admin" section, or module, if you want - and here comes the trouble
use case #1: the admin module should contain controllers for every external
module it manages, am I right? So it would be membersController and
contentController . If you decide to remove the "members" functionality, you
also need to remember you have to remove the corresponding controllers and
(at least) views in the admin module. Moreover, if you have some controllers
(let's say 5) in the members module (let's say for managing some user data)
and every controller handles different data - am I supposed to stick all the
administration logic of the five controllers to one controller:
admin/membersController?!

 

I also saw some cases, when somebody had an adminController for whole
module. Looks better, although I think many people would be confused because
of the "admin" word isn't at the beginning, but that's not such an issue.
The problem with this is the same as the second part of the previous
paragraph - you're supposed to stick admin process for every controller to a
single controller.

 

I've developed a solution using custom routes and router, allowing to detect
the application mode based on the first part of the url (/admin loads admin
controllers, /iphone loads iphone controllers and anything else loads
default controllers). They all share the models, so the only thing separated
is controllers, views and sometimes helpers. When I decide to add or remove
a module, I remove it completely from one place.

 

I've fought hardly to achieve that, though - for example I wanted to set the
controller directory in the bootstrap, but routing happens later, so I
needed to adapt to that fact. It wasn't exactly easy and straight. That
leads me to have questions like above. 

 

How you do your administration? How do you keep your modules consistent?

 

Thanks for any reply

 

Jegards

Jan

 

Reply via email to