|
I have to
throw in the obligatory and oft repeated advice that you should not be directly
manipulating session variables inside your CFCs, generally speaking. You'd
be better off having your cartModule component store things as instance
variables, then store an instance of the cartModule in the session. This
way you preserve encapsulation because the cartModule does not need to be aware
of its environment (you could, for instance, use it in the Application or Server
scope if that were more appropriate in another setting). You also avoid
any risk of overwriting the data inside the cart. You also don't need to
be aware of how the cartModule is implemented to use it -- you can then use
CFCs' strength, which is to encapsulate complexity and expose functionality
through an API defined by the methods. Then if you ever need to change how
a cartModule works internally your other code doesn't need to change because the
API of the cartModule can stay the same.
|
- [CFCDev] Just starting CFC's -- Session Question Paul Giesenhagen
- Re: [CFCDev] Just starting CFC's -- Session Questio... Paul Giesenhagen
- Re: [CFCDev] Just starting CFC's -- Session Questio... Nathan Dintenfass
- Re: [CFCDev] Just starting CFC's -- Session Que... Paul Giesenhagen
- RE: [CFCDev] Just starting CFC's -- Session... Nathan Dintenfass
- Re: [CFCDev] Just starting CFC's -- Ses... Joe Eugene
- RE: [CFCDev] Just starting CFC's -... Nathan Dintenfass
- Re: [CFCDev] Just starting CFC... Joe Eugene
- RE: [CFCDev] Just starting CFC's -... Barney Boisvert
- Re: [CFCDev] Just starting CFC's -... Joe Eugene
- Re: [CFCDev] Just starting CFC's -- Session... John Farrar
- Re: [CFCDev] Just starting CFC's -- Session Que... St�phane Bisson
- Re: [CFCDev] Just starting CFC's -- Session... John Farrar
