I'd go OO! Part of the power is that you've abstracted stuff, so you just pass the object around, vs. all these hairy variables that you'd be tracking/modifying/etc..
Theoretically using an object == less stuff to change in less places, + other OO goodness (ways of thinking about things, to put it vaguely). Theoretically. :) -- It is not enough to render things equal to the will, that they are equal or alike in themselves. Anthony Collins On Fri, Nov 13, 2009 at 12:40 PM, Rodrigo 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 -~----------~----~----~----~------~----~------~--~---
