Just to add .... Another benefit of a config bean instead of controllers using App scope is that if you add more stuff to the bean its ready to use in your model once you reload the factory. You don't need to also change the controllers to pass more stuff in to the model.
Alan ________________________________________ From: [email protected] [EMAIL PROTECTED] On Behalf Of Alan Livie [EMAIL PROTECTED] Sent: 29 April 2008 17:16 To: [email protected] Subject: [CFCDEV] Re: another n00b question I'm no expert myself but I'm currently refactoring an application and getting shot of as many Application scope stuff as I can. In some old systems we used Application scope to set global vars / constants etc In more OO systems instead of doing this we can maybe store these in a db or config file and load them into a factory / Coldspring and give the values to the objects that actually need them. So if I had an Application variable called MAX_NUMBER_OF_RESUMES_FOR_USER I would consider passing this to a factory and the factory can give it to the object that needs it when it creates it. You can also load them into a sort of a 'config' bean and give that to any objects that need it. I think controllers using them here and there isn't a big problem though but it all depends on your use case. Alan ________________________________________ From: [email protected] [EMAIL PROTECTED] On Behalf Of Charlie Griefer [EMAIL PROTECTED] Sent: 29 April 2008 17:03 To: [email protected] Subject: [CFCDEV] another n00b question Hey all... I've had a lingering question, and a thread over on cf-talk (about properly encapsulating CFC methods) has really got me thinking about it. Over on that thread, there's a "debate" (to use the term loosely) on accessing the application scope from within a CFC. Yes, I understand that's a "bad thing" and I understand why. But in an MVC framework... what about CFCs in your controllers? Those CFCs don't really model any particular object. They're more of a transport mechanism to facilitate communication between the model and the view. So, I get that CFCs in the model should be encapsulated. But what about CFCs in the controller? is it "acceptable" (which i realize is a subjective term) to access shared scopes like application and session from controller CFCs? -- Evelyn the dog, having undergone further modification pondered the significance of short-person behaviour in pedal depressed, pan-chromatic resonance, and other highly ambient domains. "Arf," she said. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
