Even considering my stupidity on the matter of type validation, I'm still having some trouble with this concept.
My plan was always to use polymorphism but to abstract the DB stuff "down" not "up". For example I've got a "DP_Session" component that abstracts session information, clickstreaming, agent data, etc. My plan was to make that component DB-agnostic by, inside of it, determining the DB type then including DB-specific code for the basic functions. The basic stuff could be extended to any number of DBs and the root component would never need to be touched. Now in use, however, the specific application might want to add functionality to the Session component (for whatever reason). That app would extend the base session component and add the functionality needed (or overwrite basic functions). Using only one base component means that the new app could change databases easily - they would only have to change any custom DB code (if any) in their extended component. However if I create DB-specific extended versions of the Session component then the work of switching DBs becomes more difficult, right? They'd have to change their components to extend a different set of DB-specific components rather than the one generic component. Also for many of these components the persistence parts are quite small - it still seems odd to me to extend a very large component to change just one small thing (although I suppose that's more due to my lack of OO thinking as well). Basically I'd just rather have the end users always say "create a session" and never have to worry about what DB is in use. I think there is where the factory classes come into play, but at some point you have to define things and worry about it. My "DP_App" component, right now, stores the DSN information (DB type). I create an instance of it, then add in all the information (include DSN stuff). To do this it seems like I would have to have some other component (a factory?) collection this information first, then decide what kind of DP_App to instantiate, then use that to drive all the other factories. It seems like that adds a lot of complexity for not much gain over just determining, in the base component, which DB-specific code to call at run time. What am I missing (besides a Comp Sci degree)? Jim Davis ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
