Makes perfect sense to me, I do think you are overthinking it a bit though :). Seems to me it would be as simple as storing the document id in the content record in the database. The way I'm seeing it, your getDocument method would return the content. The query would look something like this... <cfquery> SELECT ID, Content, ... FROM Content WHERE DocumentID = #docID# </cfquery>
jon ----- Original Message ----- From: "Phillip Cave" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, June 26, 2002 1:57 PM Subject: RE: Objected Oriented Design ( was RE: ) > I'm kind of new to the object oriented stuff and I'm just not sure how > to store the result of running a method such as > document.documentAdd(...), which would also run the addContent() method > of the content object since they are related (assuming I have a content > table and a documents table to hold the objects data). So what I'm > wondering is how should objects are stored relationally. If it's as > simple as storing the contentID w/ the documents data, then I guess I'm > over thinking this a bit ;) > > Oh, and I was planning to run such methods as > document.getDocument(someID) which would run a db query and return a > structure containing the documents data and the general content data. > > I'm probably not making much sense... But I'm trying ;) > > Thanks, > > phillip > > > -----Original Message----- > From: Jeffry Houser [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 26, 2002 1:37 PM > To: CF-Talk > Subject: Objected Oriented Design ( was RE: ) > > > I'm still a bit confused. Perhaps it is because I misunderstand your > purpose. > > Components do not store data in the same way that databases do. > > I think you are on the right track to incorporate object oriented > methodologies into your development, though. > > You have a content object with the properties: ContentID, Title, > DateAdded (etc). > And some methods: add, (etc) > > Are you planning on running queries from the database, then invoking > the > component and 'populating' the properties? Or... ?? > > > At 01:07 PM 6/26/2002 -0400, you wrote: > >Well, I'll be using CFC's to create the components (i'm attempting to > >create the class structures, i'm just not sure how to store the data > >they represent). Also, There will be additional items related to > >content... Things such as images, events etc., all which should inherit > > >the generic properties of content. > > > >Does that help? > > > >Thanks! > > > >-----Original Message----- > >From: Jeffry Houser [mailto:[EMAIL PROTECTED]] > >Sent: Wednesday, June 26, 2002 12:57 PM > >To: CF-Talk > >Subject: Re: > > > > > > I'm not sure if you are you trying to create an Object Oriented > >class structure, or a database design, so I'm a bit confused all > >around. > > > > But, based on my understanding... > > > > You have two tables: a content table and a document table. The > >content table contains a lot of generic information that relates to > >many different types of data. The document table is a specialized > >version of > > > >'content'. > > > > I would put the ContentID in the Document table. > > > > If your content table doesn't relate to anything other than than > >document, then there may not be a need for two tables. > > > >At 12:00 PM 6/26/2002 -0400, you wrote: > > >Hello everyone, I'm wondering how I would represent the following > > >case in a database. > > > > > >I have a general content class that contains generic information > > >about a piece of content. I then have more specific classes such as > > >document (which will inherit the content class). How would I go about > > > >relating > >the > > >two in the physical database? So far classes look like so: > > > > > >-------------- > > >| content | > > >-------------- > > >| -contentID | > > >| -title > > >| -dateAdded | > > >| -etc... | > > >|------------| > > >| +add(s) | > > >| +etc... | > > >| | > > >-------------- > > > > > >-------------- > > >| document | > > >-------------- > > >| -documentID| > > >| -fileName | > > >| -fileSize | > > >| -etc... | > > >|------------| > > >| +upload(s) | > > >| +etc... | > > >| | > > >-------------- > > > > > >How do I represent the 'document' is a 'content' relationship in the > > >DB? Would the content class contain the ID of the more specific class > > > >(ID > >of > > >the document)? > > > > > >And please excuse me if my ASCII art isn't up to par :) > > > > > >Thanks, > > > > > >Phillip > > >FAQ: http://www.thenetprofits.co.uk/coldfusion/faq > > >Archives: http://www.mail-archive.com/[email protected]/ > > >Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists > > > >-- > >Jeffry Houser | mailto:[EMAIL PROTECTED] > >Need a Web Developer? Contact me! > >AIM: Reboog711 | Fax / Phone: 1-203-379-0773 > >-- > >My CFMX Book: > ><http://www.amazon.com/exec/obidos/ASIN/0072225564/instantcoldfu-20> > >My Books: http://www.instantcoldfusion.com > >My Band: http://www.farcryfly.com > > > > > > > > ______________________________________________________________________ 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 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

