What's the deal with haters hatin' on our old friend the base class? Maybe you can implement base class functions like getAction using a dispatch level plugin, but how is that better than a simple abstract class to base your controllers around? My actual controllers are 80% method free, it's all done in the base class, I only ever have to override on occasion - it seems like a solid solution to me, why is it considered less than ideal?
On Tue, Dec 22, 2009 at 5:21 PM, Colin Guthrie <gm...@colin.guthr.ie> wrote: > 'Twas brillig, and Taha Bayrak at 22/12/09 06:23 did gyre and gimble: > > What is the best practice for placing the base controller classes? > > Ideally, don't use them at all. You can use action helpers to group up > common tasks into one handy call... > > You can also have plugins work at the dispatch loop level which can be > handy. > > Sometimes it just feels nicer to have a base class tho'. > > > a. Placing them in the same directory as the other controllers - the > > ones that extends from the base class -? If so, is there a easy way to > > prevent the base class getting into the dispatch loop? > > Just prefix the class with the word "abstract"... i.e. abstract class > MyBase_Controller { .... } > > That way the class cannot be instantiated on it's own. It may be a nasty > crash tho'. > > Personally I'd put it in a subdirectory of the Controller folder to make > sure. > > Col. > > -- > > Colin Guthrie > gmane(at)colin.guthr.ie > http://colin.guthr.ie/ > > Day Job: > Tribalogic Limited [http://www.tribalogic.net/] > Open Source: > Mandriva Linux Contributor [http://www.mandriva.com/] > PulseAudio Hacker [http://www.pulseaudio.org/] > Trac Hacker [http://trac.edgewall.org/] > >