Nolan, I'd lean away from passing in Coldspring into your model.
I know it might seem like an OK shortcut, but it is limiting, brittle and breaks encapsulation. Things should only know what they need to know to get the job done. Being ColdSpring aware seems to be a bit much. By being explicit and configuring your model with exactly what it needs will leave you a great application blueprint to reference as you grow and maintain your application. At all costs, strive to leave these blueprints as detailed as possible and avoid shortcuts, because they are rarely as short as they seem, and they have pointy teeth :) DW Sent from my Verizon Wireless BlackBerry -----Original Message----- From: Nolan Erck <[email protected]> Date: Thu, 8 Apr 2010 17:42:12 To: <[email protected]> Subject: [CFCDEV] Passing ColdSpring in as an argument? I've got a handful of Service Layer CFCs that all take your pretty standard set of arguments on the init() method: <cfargument name="userDAO" type="model.User.userDAO" required="true" /> <cfargument name="userGateway" type="model.User.userGateway" required="true" /> Once in a while I'll find that I'm in (for example) the UserService, and I want to fire off a method in one of the *other* Service CFCs. Since all of them are wired up via ColdSpring, I could just do something like so, inside each Service CFC: <cfset foo = application.coldSpring.getBean( "someOtherService" ) /> ....but that's breaking encapsulation. Is there a was pass IN a reference to ColdSpring via the init() arguments? This strikes me as probably a circular logic problem (how can ColdSpring be passed in as an argument if it hasn't finished initializing itself yet?), but I'm hoping there is a workaround. Does that make sense? How do the rest of you access ColdSpring from within a Service Layer that itself was instantiated via ColdSpring? Thanks, Nolan -- You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en. -- You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en.
