On 1/5/06, Ben Nadel <[EMAIL PROTECTED]> wrote: > The issue was about half way though this process I realized that I needed to > pass in my SecurityController and the User instance to the page Init() > method to figure out which parts of the global layout would be accessible > (based on permissions). The problem was that originally I was doing this > sort sort of IoC via Init() argument passing. However, with this new change, > I would have to go to all the sub component to change the arguments of all > overridden Init() methods. ... > So, any comments or suggestions? Blatent mistakes?
I think this illustrates perfectly why an IoC framework / container is so valuable since it abstracts all of these dependencies out of the code and into a config file. If you had been using ColdSpring (or ChiliBeans) from the get-go, you would have simply changed the XML file (and maybe added a setXxx() method here and there). Thanx for sharing this because it really does help show how quickly dependencies can expand and "pollute" your business logic. As an aside, this is along similar lines to how much "housekeeping" bleeds into C++ code because constructors, destructors, copy constructors and assignment operators all need to be coded explicitly... Java removes some of that by handling memory management automatically but still the construction dependencies remain. -- Sean A Corfield -- http://corfield.org/ Got frameworks? "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
