cfc accessing session scope - bad?

2010-05-20 Thread Matthew P. Smith
Is it a bad practice to have a cfc access a session variable? Should the session variable be passed in as an argument instead? ~| Order the Adobe Coldfusion Anthology now!

Re: cfc accessing session scope - bad?

2010-05-20 Thread Cutter (ColdFusion)
Best practice is to pass in the session variable. There can be issues with calling a persistent scope directly within a CFC, typically around application performance and proper garbage collection. Steve Cutter Blades Adobe Community Professional - ColdFusion Adobe Certified Professional

Re: cfc accessing session scope - bad?

2010-05-20 Thread Brian Kotek
In general, yes. The exceptions are if you have a method specifically meant to encapsulate access session scope so that other methods in the object can get to that data (i.e. a getCurrentUser() method in a UserService), or if you create a dedicated SessionProxy object that other objects use to

Re: cfc accessing session scope - bad?

2010-05-20 Thread Adrian Moreno
I've got an example of a Session Facade (or Session Proxy?) on my site: http://www.iknowkungfoo.com/blog/index.cfm/2007/2/12/Using-a-Session-Facade-to-handle-evolving-session-variables --- Adrian In general, yes. The exceptions are if you have a method specifically meant to encapsulate access

Re: cfc accessing session scope - bad?

2010-05-20 Thread Eric Cobb
Me too! Me too! Me too! :) http://www.cfgears.com/index.cfm/2009/12/3/Using-a-Session-Facade-in-ColdFusion I can vouch for Adrian's article, though. When I first started working with Session Facades in Mach-II, the post he linked to below went a long way in helping me understand them.