Often it depends on what data you are accessing.

I often make objects that know how to retrieve themselves... so for example,
in my application I might have a currentMemberLoader object that knows how
to get the userID from the session and load a user object from it. The
session is only accessed as a private function and as such, doesn't cause
any scope leakage or misencapsulation.

Should I decide to cluster my application, I can change the session to
another scope without impacting any other areas of my application.

I guess the philosophical question is not how do you access session data
from a view, but more, why would the view care where the data came from
anyways?


DW

On Thu, Jan 21, 2010 at 8:14 PM, django radonich-camp <[email protected]>wrote:

> hey all, in short, I am looking for any suggestions/best practices for
> accessing data stored in the session scope and using it in a view
> template
>
> to explain the specifics a little more in depth, in this particular
> application, we are using a session facade service to access the
> session scope.  in the controller layer and beneath, we simply use
> coldspring to inject this service wherever its needed.  some of the
> objects we are putting in the session scope will need to be accessible
> in the viewstate as well though.  to do this, we have been using an On
> Request Start listener (and method) to set the session facade service
> to the viewstate.  this makes it available, so far, everywhere we've
> needed it within the viewstate.
>
> i'm wondering if folks out there have any other preferred methods or
> better ideas?  or even feedback on the approach we are using?  i've
> also seen a suggestion to make the session facade service available
> via the application.cfc, but have not tried that route.
>
> thanks.
>
> django
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<model-glue%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en




-- 
“Come to the edge, he said. They said: We are afraid. Come to the edge, he
said. They came. He pushed them and they flew.”

Guillaume Apollinaire quotes

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to