Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: I need my services available from...well... everywhere

$
0
0

Thanks, Aegis! You paint the picture clearly.

 

I share your preference for OO and 'information hiding'. Like you, I have found that combining ColdFusion's native rules of thumb with those of OO can be complex. However, I have often solved difficult design problems by looking instead into the converse of a rule.

 

Take your own design, for example:

some of the objects I'm storing in the application.cfc's variables scope

 

According to this, the variables are privately owned by the Application.cfc component. Therefore, by your OO reasoning, which is quite correct, any template or component that requires such a variable must obtain it via a function call. That would imply instantiating Application.cfc.

 

However, that would break one of the fundamental rules of ColdFusion. Generally, Application.cfc is not designed to be instantiated.

 

It is at a point like this that I would reevaluate the use of variables scope in Application.cfc. In fact, one obvious solution is to store variables meant for template requests in the request scope within onRequestStart. As they say, what's in a name?

 

Then again, Carl suggested this, too. You actually thought of it earlier yourself! So, I'll stop trying to sell this fridge to an Eskimo.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>