Boson, welcome. I like your name.
 
First thing to think about is what type of relationships you want to use to model Page and Lecture and Activity. I'm not sure how much studying you've done on the difference between inheritance and compostion. To keep it short and to the point, i highly doubt that Lecture and Activity should extend Page. On a high level, conceptually, it makes more sense to me that a Page can be composed of information about a Lecture or an Activity - maybe both - you might have several Activities or Lectures on a Page.
 
But to get us on the ground with a functioning web application your model might turn out differently than you first conceive of it on a high level. Let's say you print out a mock up of one of these pages and your 6 year old child (i'm very liberally assuming you have a 6 year old child) started pointing to various parts of the page.
 
What's that?
 
That's a Banner
 
What's a banner?
 
Well, it's just an Image actually.
 
What's that?
 
Oh, that's the Navigation
 
What's that?
 
That's the Content
 
What's Content
 
Well, on a web Page, Content is made of Text and Images
 
How does it get there?
 
Well, when i build a Page, i need to arrange the Content in a Layout.
 
What's a Layout?
 
Well, a Layout is ... well, it's really just a group of Containers that I put the Content in.
 
So what i'm saying with the little story there is that while on a higher conceptual level, you might be at first thinking of a model in terms of Pages, Lectures and Activities, it might be useful to look at it from another perspective at the same time, more a nuts and bolts thing of what is a page composed of when the application actually has to build it. You might wind up with Lectures and Activities in your model, but i think things will fall into place easier for you if you include the nuts and bolts stuff ... if what you're actually thinking of doing with the app is to build web pages.
 
I'd actually suggest printing out a mockups of your pages, pointing at various parts and keep asking yourself "What's that?" - you'll have a first sketch of your model sussed out pretty quickly that way.
 
ciao,
Nando
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Boson Au
Sent: Wednesday, November 02, 2005 11:11 PM
To: [email protected]
Subject: [CFCDev] New to OO, question about inheritance and DAO's

Hi, I’m building my first OO app and I have a question regarding inherited classes and how they correspond to DAO’s.

 

Here’s my situation:

 

I’m building a pageManager application that basically stores different types of “pages” of a course. Currently there are two types of pages: Lecture and Activity.

 

This is how they break down:

 

A generic page has

pageID              INT

pageTitle           string

courseID           INT

pageLanguage   INT

pageDescription string

pageType          INT

 

a Lecture is a child of page with

lectureID           INT

lectureNumber   INT

faculty(s)           Array(1) of faculty objects

 

and Activity is a child of Page with

activityID           INT

activityContent   text

 

 

 

I’m really confused as to how to design DAO’s for this.  I want to be able to have a pageManager cfc that takes a pageID as a field and returns either a lecture or activity object.  

 

Do I build multiple DAO’s that corresponds to each different subclass (ie: a lectureDAO and an activityDAO)? 

Do I build one pageDAO that has in its CRUD logic that handles what databases to work with based on the class?

 

 

Boson Au

Web Content Developer

Center for Teaching and Learning with Technology

Johns Hopkins University Bloomberg School of Health

[EMAIL PROTECTED]

410-223-1671

 

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to