One of the minor side-effects of the way ColdSpring easily handles
more and more complexity is that I found my ColdSpring XML file got
out of  control unless I took an organised approach to the layout.

My first few ColdSpring sites had about 20 CFCs or so to manage, and
without thinking much, I'd just add a new CFC to the bottom of the XML
and that would be fine.   But then i built a site that had many more
CFCs than that, and i found my XML file got unmanageable.   I was
getting errors because i was duplicating the XML definition of CFCs
and omitting some altogether.    I found i had to be more organised
than the XML equivalent of the shoebox filing system.

I tried putting the CFCs into the XML file in alphabetical order,  and
that didn't really work.  It improved things a bit,  but what worked
most was to put CFCs related to different parts of the application
together - all the USER cfcs together and all the CONTENT cfcs
together and all the CATALOG cfcs together etc.  With comments between
the sections of the XML file, so they are easy to find.

THEN Coldspring showed its magic. It happily handled the management of
hundreds of CFCs, all their dependencies, locations, how they are to
be instantiated, and all i ever had to do in a calling page was
something like:

<cfset UsersDAO = application.beanfactory.getbean("UsersDAO")>  and i
never had to worry again about how to instantiate it,  where it was,
what other cfcs it depended on, where to find them,   whether
parameters or other objects were required in the init() method,  etc.

If i ever change my hard drive layout - move my CFCs around - there's
only one file that ever needs to know where to find them - the
coldspring XML file.

As i said,  MAGIC!   All i have to do is 'hey Coldspring - give me a
UsersDAO object' and it knows what to do , and just does it!

Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month


On Sun, Jul 26, 2009 at 1:25 AM, Glyn Jackson<[email protected]> wrote:
>
> I see, thanks for taking the time to explain, you have been very helpful.
>
> Glyn.
>
>> On Fri, Jul 24, 2009 at 1:36 AM, Glyn Jackson<[email protected].
>> uk> wrote:
>> > what are the benefits of working this way, am just ignorant having
>> never used it or AOP before in CF. Any docs online you can point me to
>> (I dont know what I would be looking for)
>>
>> As the number of CFCs being created / initialized increases, the
>> benefits of ColdSpring increase because you don't need all that code
>> inside your CFCs ("this could have been all done in the init() method
>> or I could have extended the CFC or I could have passed in the
>> details
>> from config CFC without ColdSpring"). That means that dependency
>> changes can be made without changing your code, including using AOP
>> to
>> add logging, security etc etc.
>>
>> ColdSpring is one of those tools where you can't really "get" it
>> until
>> you've experienced the problem it solves and then it's a real
>> lightbulb moment.
>>
>> I wasn't sold on IoC / DI tools at first. When I really saw the light
>> it was working on a Mach-II application (years ago, at Macromedia)
>> and
>> having to deal with complex and ever-growing configuration data. I
>> needed a way to separate configuration from code and Mach-II's
>> XML-based approach wasn't cutting it. So I rewrote the app using
>> Model-Glue 1.0 and an external XML file for configuration data (using
>> ChiliBeans, MG1's IoC container). As far as I was concerned, it was
>> still just externalizing configuration, albeit object-based
>> configuration. As the application grew, the bean factory really
>> started to take the load off my hands as it could take care of
>> increasing complexity without impact to my code. Then I switched to
>> ColdSpring because it was more capable than ChiliBeans and I never
>> looked back!
>> --
>> Sean A Corfield -- (904) 302-SEAN
>> Railo Technologies US -- http://getrailo.com/
>> An Architect's View -- http://corfield.org/
>>
>> "If you're not annoying somebody, you're not really alive."
>> -- Margaret
> Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324967
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to