I have seen many apps with objects in the session scope, and the problem
there is scalability.  I have more often put an ID value or some PK or
composite key in the session scope (strings or numbers) rather than an
object, and re-init the object from your transfer or ORM cache as the
requests begins.

This may have some small object-instantiation penalty, but keeping the
server stable memory-footprint wise is more important, imo, as you scale up.

Best of luck,

Chris Peterson


On 11/13/09 2:40 PM, "Rodrigo" <[email protected]> wrote:

> 
> I'm building an app for a store, and I'm building the checkout.
> 
> I can see two ways of doing it and I wanted to get your input as to
> which way to do it.
> 
> 1. the more OO way of doing it would be to instantiate the object in
> the session scope so it can be accessed throughout the checkout
> session. In the object, I would create an instance and set the
> parameters for the checkout like billing address, shipping address,
> etc. and then all I need to do is set/get data from within the object
> throughout the session.
> 
> 2. the other way of doing it, which would leave a smaller footprint in
> the session scope would be to only set the variables in a session
> structure like: session.store.checkout.shipping.address1, etc This way
> only the data that needs to stay in the session stays there and the
> rest is destroyed at the end of the request.
> 
> Any thoughts?
> 
> I understand that either way would get me the desired results but I'm
> curious as to see what would be considered "best practices"?
> 
> Also if there's another way of doing it that I haven't thought of I
> would appreciate a nudge in the right direction.
> 
> BTW, I am using Model-Glue 3.1
> 
> R
> 
> > 



--~--~---------~--~----~------------~-------~--~----~
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