--- In fusebox5@yahoogroups.com, Sean Corfield <seancorfield@...> wrote:
>
> On Mon, Jun 22, 2009 at 2:15 PM,
> I'm surprised you can call Application.isProduction() from a model CFC
> in your local dev environment.
You should be! I was mistaken! I thought it worked in my local dev env because
I hadn't encountered the error, but it was there.
>
> Yes, the variables scope of Application.cfc is available in your
> views. It's also available as myFusebox.variables() which you could
> use in the controllers (or model circuit if you're using a Fusebox
> circuit for the model rather than standalone CFCs).
>
> That said, I really wouldn't recommend this sort of thing. Relying on
> Application.cfc methods being available "everywhere" is not very well
> structured, to say the least. Application.cfc is meant to handle the
> lifecycle of the application: startup/shutdown for application /
> session / request. It's not meant to be a 'kitchen sink' for utility
> methods.
I absolutely agree. I was just playing around, and surprised to see that I
could call an app method in a view (without even specifying the scope -- just
plain ol' "isProduction()" worked), and wondered why it didn't work in the
controller cfcs. Makes perfect sense now that I know I was mistaken about it
working in my local dev env.
BTW - Fusebox5.5 is the best! I've used FB since v2, and quit using it after v4
for a while. With the excellent flexibility of 5.5 and the option to avoid xml
configs altogether, I'm very grateful for all the work you put into it.
Cheers,
Dave
>
> What I typically do is have some sort of configuration CFC that
> encapsulates all the differences between dev / qa / prod / etc as much
> as possible and then make that available to other components as needed
> (storing it in myFusebox.getApplicationData() for use in views and
> controllers and then initializing the model with a reference to that
> config CFC as appropriate).
> --
> 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
>