Hi all,

I'm a bit stuck about the architecture I need to design and hope some of you 
can give me some hints.

A certain action controller needs to build a page containing a Zend_Form 
instance and some html. The form contains subforms which are generated by 
other modules. The html is concatenated by rendered view scripts of different 
modules.

So in pseudo code:
$form = new Zend_Form;
$html = '';
foreach ($modules as $module) {
  $form->addSubform($module->getForm());
  $html .= $module->getHtml();
} 

And the question is: what should $module be: a service layer, a model, a 
action controller, something else?

After the form has been posted, the system needs to return all the values of 
the subforms to the appropriate modules. Currently I use service objects in 
the service layer ({Module}_Service_Admin), but this single class becomes very 
heavy. Think of a portfolio service class which needs to be able to create, 
update and delete portfolios, portfolio categories and portfolio projects and 
provide listings of categories and projects. It becomes really heavy.

If you can give any advice, that would be great! Thanks in advance,
Best regards, Jurian

PS. I posted this question with a slight longer story at SO: 
http://stackoverflow.com/questions/4679334/architecture-advice-of-zf-admin
-- 
Jurian Sluiman
Soflomo - http://soflomo.com

Reply via email to