I've discussed the "individual controllers" idea before.. this is the
way Rails does it - where each module essentially has one class (a
"controller") that is made up of methods - one for each action in your
module. So instead of one execute() method per Action class, you'd
have a class with lots of methods like actionIndex() and actionList()
and actionEdit(), etc...
Like you (and a number of us), I have begun to feel bloat in having an
Action class for every action in every module. Ideally something
similar could be done with views. These were things that I was
wanting to tackle in a post 1.0 release, but now that Agavi as we know
it may not have a post 1.0 release, I'm not sure if/when it will get
addressed.
illusina's vision of Mojavi 4 may deal with this shortcoming though...
anyone know/care to comment?
--Bob
On 9/8/05, J. Erik Heinz <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Today i would say i started to use agavi really. I created some
> different Modules and Actions. In doing so i recognized that I create a
> lot of files, which makes the maintaince quite difficult. By itself
> its build up very logical like, every action has an corresponding view
> and template:
> IndexAction.class.php
> IndexSuccessView.pho
> IndexSuccess.php
>
> But if you have like 3 Modules echo with 4 Actions, its about 36 Files.
> In my I it seems to be to much.
> I though a little bit over this problem and found the conclusion that
> it would be nice to have one controller respectively action which manage all
> the controlling stuff.
> I.e: MainAction.class.php which could look like this:
>
> public function execute() {
> $oModel = new $sAction . $sModule . "Data";
> $aValues = $oModel->execute();
> $this->getContext->getRequest()->setAttribute('aValues',
> $aValues);
>
> return View::$sView;
> }
>
> I have that feeling that this certainly could be realizable with agavi,
> but I could't figure it out how to do this...
>
> The Params of the URL decide which action will be called. And here I
> have to turn around it to a central Controller/Action where I
> could manage the contronlling of my models and views.
>
> In my Eyes this would minimize the amount of files at least about 9
> files - it's an beginning :)
>
> How do you manage this?
> Perhaps has my aproach as well some failures that I didn't recogize,
> but with the actual situation with one Controller for each action i'am
> not relly happy.
> Any alternative ideas?
>
> Regards Erik
>
> --
> J. Erik Heinz
> Keyboard-samuraing in process
> _______________________________________________
> agavi-dev mailing list
> [email protected]
> http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev
>
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev