----- Original Message ----- From: "Raymond Camden" <[EMAIL PROTECTED]> > Let's say you have > a multi-step edit form. You may want to store the CFC in the session > scope so it persists. On the other hand, if you had a Create Article > form, you may create a local instance of CFC, store the data, and be > done with it. ----------------------------
I'm a CF newbie, halfway through an intro book, and I thought I'd jump in here to ask something quite general that is closely related to all this. Since I'm generally basing my current CF efforts on the Model-Controller-View "pattern", I've taken it on board from several sources that it's a good idea to use CFC's exclusively for the Model layer, i.e. interactions with data. So it's slightly confusing to read 'Discovering CFCs' and read all about "getters" and "setters" that just manipulate an object instance, nothing to do with the DB. I fully appreciate that any intro to OO-related concepts would need to cover this object manipulation as basic, and that it's possibly an abitrary decision on my part to use CFC's just for data calls. But to me (this is me-not-really-knowing-much-about-CFCs-and-OO-yet ;) it seems like this kind of OO behaviour is most suited to a "stateful" application environment like a desktop app or Java applet - not stateless toing-and-froing as per CF over the web. I've been trying to think of useful examples of CFC use that wouldn't involve data calls and would actually take advantage of an objects persistence and manipulability. I guess a User.cfc instance in the session scope could be useful - but how much more useful than a "user" structure in the session scope? Multi-step forms is another possibility, holding data before committing it to the DB. But again, what real advantage over a structure? Am I just missing out on the actual practice of using CFC's, where their advantages become obvious? Gyrus [EMAIL PROTECTED] work: http://www.tengai.co.uk play: http://norlonto.net PGP key available ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

