Hey Guys,
I hope you're all well, I've got a challenge when it come to composition which I was hoping you could give me a few pointers on, Basically I have a scenario in my application which has a supertype/subtype relationship between a bunch of tables and I'm struggling with how to build this kind of relationship between my objects. I'm not sure if you've worked with the supertype idea before, or heard the term, Its actually quite simple from a database point of view. I'll help clarify it with an example. In my application I deal with lots of different types of multimedia, such as Images, Text Files, Audio, Video, Games and a myriad of other things, however my application needs to be able to access these different media types from a single location in the database. So I have a single table called 'Media' which contains all the common details between different media files, like ID, Name, Size, DateCreated and such like, and then I have a myriad of different tables, like Text, Image, Audio, Video which contain all the unique information for each different type of message, along with a FK which links them back to my 'Media' table. Now what I need to be able to do is create a Media object within my application, but also have access to that additional information for when I write it to the database, and likewise when reading out. I'm not sure whether this is best solved with some form of composition, or perhaps this is where the 'Extend' attribute will come in handy for me? Create the media object as the Base class and have my other media types Extend it? I really don't know. What do you think chaps? I hope I haven't confused you too much with my babbling question. Thanks, Rob ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290643 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4