On 10/29/07, Brian Kotek <[EMAIL PROTECTED]> wrote:
> just because I do this, I was missing the fact that many people might not
> impose the same limitation on themselves. By eliminating the centralized
> facade, you're not even giving other services the possibility of digging
> into shared scope data that is outside their area of concern.

Right, and that's the rub... I do a lot of code audits these days and
I see this cropping up over and over again: too many developers can't
resist the "convenience" of accessing other service's data via the
shared scope facade instead of going about it the "right" way. So I
push hard to eliminate the temptation in order to break them of their
bad habits :)

> OK, I'm sold. ;-)

Cool!

> Still, if you could comment on your approach to dealing with the session
> scope in your services I'd be interested. Do you use a direct reference to
> the session scope? Or some other approach?

In general, I isolate it into one private method that has a direct
reference to session scope. The exact mechanism depends on what the
cached object is and how it is initialized.

For mock testing, just extend that service CFC and override that one
method. That one method is often responsible for creating the cached
object on-demand so the extended mock can double up as both a mock for
the cache access and a way to substitute the creation of the cached
object.

Make sense?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292308
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to