If you want, check out Brian Kotek's BeanInjector, which could possibly provide you with a nice way of autowiring your controllers manually, maybe with a base class or something similar: http://coldspringutils.riaforge.org/
Mark On Thu, Jun 19, 2008 at 2:37 PM, Adam Chapman <[EMAIL PROTECTED]> wrote: > > Hi Mark, > > From what I can find in the latest fusebox docs and googling, there is > no inbuilt way to autowire the dependencies to the controllers, but this > is precisely what I'm after. > > It has been suggested on a blog post somewhere, but is not implemented > in FB5.5. However, I see that my Corfield had evaluated it during the > current version's development so I wouldn't be surprised if it turns up > in a future release.. > > Looks like I will have to do the wiring myself for the time being.. > > Regards, > Adam > > > -----Original Message----- > From: Mark Mandel [mailto:[EMAIL PROTECTED] > Sent: Thursday, 19 June 2008 10:11 AM > To: [email protected] > Subject: [cfaussie] Re: Coldspring Best Practice > > > I don't know Fusebox at all.. but is there a way to autowire your > dependencies into your controllers with Fusebox? > > You can do this with MG, Mii, CB... it's a really nice feature. > > Mark > > On Thu, Jun 19, 2008 at 10:13 AM, Adam Chapman <[EMAIL PROTECTED]> wrote: >> >> Hi Mark, >> >> I'm using fusebox 5.5 (no-Xml). >> >> Regards, >> Adam >> >> >> -----Original Message----- >> From: Mark Mandel [mailto:[EMAIL PROTECTED] >> Sent: Thursday, 19 June 2008 10:08 AM >> To: [email protected] >> Subject: [cfaussie] Re: Coldspring Best Practice >> >> >> Adam, >> >> What are you using to manage your Controller? >> >> Something like Model Glue, MachII? >> >> Mark >> >> On Thu, Jun 19, 2008 at 9:40 AM, Adam Chapman <[EMAIL PROTECTED]> wrote: >>> Hi All, >>> >>> >>> >>> I have started implementing Coldspring into an app I'm working on and >> I was >>> after some opinions on the best way to call the beans. >>> >>> This is a fusebox 5.5 (noXml) implementation. >>> >>> >>> >>> My main aim is to avoid lots of 'unnecessary' code but keeping >> performance >>> at a maximum. >>> >>> >>> >>> I think I have 2 primary options.. (Pros & cons as I see them..) >>> >>> >>> >>> 1. Set all coldspring beans into local variable scope on every > request >> in >>> application.cfc >>> >>> <!--- application.cfc ---> >>> >>> <cfset thisService = application.beanFactory.getBean("thisService") > /> >>> >>> <cfset thatService = >> application.beanFactory.getBean("thatService") /> >>> >>> ... 20+ beans >>> >>> >>> >>> Pros: Ease of maintenance, results in shorter syntax >>> >>> Cons: Possible performance hit >>> >>> >>> >>> >>> >>> 2. Set only the beans needed for the request in the controller and >> also make >>> it available to the view templates >>> >>> <!--- controller ---> >>> >>> <cfset var thisService = >>> application.beanFactory.getBean("thisService") /> >>> >>> <cfset var thatService = >>> application.beanFactory.getBean("thatService") /> >>> >>> <cfset event.setValue("myQuery",thisService.myMethod()) /> >>> >>> <cfset event.setValue("thatService",thatService)) /> >>> >>> >>> >>> <!--- view ---> >>> >>> <cfset myQuery = event.getValue("myQuery") /> >>> >>> <cfloop query="myQuery"> >>> >>> #thatService.formatMe(myQuery.column)# >>> >>> </cfloop> >>> >>> >>> >>> Pros: All beans not copied to local variables scope every >> request >>> >>> Cons: More code to do the same job as scenario 1 >>> >>> >>> >>> Any comments appreciated. >>> >>> >>> >>> Regards, >>> >>> Adam >>> >>> > >>> >> >> >> >> -- >> E: [EMAIL PROTECTED] >> W: www.compoundtheory.com >> >> >> >> > >> > > > > -- > E: [EMAIL PROTECTED] > W: www.compoundtheory.com > > > > > > -- E: [EMAIL PROTECTED] W: www.compoundtheory.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" 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/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---
