In my case I created an object called SessionListener which knows everything about the session.  It has methods for setting stuff in the session, and getting stuff from the session.  In my events, I simply use the 'getter' methods to retrieve copies of my session objects and place them in the request scope, or use the 'setter' methods to persist them in the session.  This prevents the rest of the app from needing to know anything about the session.

This approach also means I could rip the guts out of my SessionListener and replace it with a bunch of calls to DAO's, and the rest of the app would be none the wiser.  The method of persistence is not really important at that point .. now that I think about it, 'PersistenceListener' might have been a better name =).

Cheers

Eric Knipp
Web Applications Supervisor
Unitrin Specialty - Insurance for U
www.unitrinspecialty.com


On 5/9/05, John Beynon <[EMAIL PROTECTED]> wrote:
with a session facade.

Brian Kotek has a good example MachII bookstore
(http://www.briankotek.com/index.cfm?fuseaction=coldfusion.main ) which
shows how he handles it,

jb.


On 5/9/05, Mike Kear <[EMAIL PROTECTED]> wrote:
> Its gradually getting lighter. It's like the dim light of approaching
> dawn as gradually this OOP/CFC stuff comes clear.  I'm even having a
> go at writing my own simple application, because I figure while I'm
> quite good at selling, and I spent most of my career in sales,  I have
> doubts about whether I'm going to be able to make a living selling
> sites that only display "Hello World" and that's it.
>
> So ... I'm thinking .. if all these components are supposed to be free
> standing as far as possible,  and no information is shared between
> them other than what is passed as arguments,   how do they handle
> session information.
>
> For example, for many reasons I want to know who updated, who added,
> who deleted information and when.  In prior days, I've had the
> following in my queries:
>
> ...
> addedby = '#session.auth.login#',
> dateadded = #createodbcdatetime(now())#,
> ...
>
> But since the objects are not supposed to know about anything other
> than themselves,  how do I get my audit trails now?
>
> --
> Cheers
> Mike Kear
> Windsor, NSW, Australia
> Certified Advanced ColdFusion Developer
> AFP Webworks
> http://afpwebworks.com
> ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
>
> CFCDev is supported by New Atlanta, makers of BlueDragon
> http://www.newatlanta.com/products/bluedragon/index.cfm
>
> An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
>
>

--
<a href="" href="http://spreadfirefox.com/community/?q=affiliates&amp;id=734&amp;t=1"">http://spreadfirefox.com/community/?q=affiliates&amp;id=734&amp;t=1" >Get
Firefox!</a>


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to