Title: Message
Is employee really a subclass of person, or is employee just a role that a person has? Here is a blurb from Barney Boisvert's blog on the topic:
 
http://www.barneyb.com/blog/archives/000310.jsp

is-a, has-a - These are the two core types of relationships between objects.  Is-a relationships are inheritance, where you say "a Corvette is a Car is a Vehicle".  Has-a relationhips are composition, where you say "a User has a Role which has some Responsibilities".  Wherever there is ambiguity between which type of relationship to use, the natural instinct is usually to go with is-a, but the proper solution is usually to go with has-a.  ; )
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Samson
Sent: Tuesday, February 14, 2006 6:20 AM
To: CFC DEV
Subject: [CFCDev] DAO Inheritance

I have a base object 'person' for which I have defined both a personObj to hold information and a personDAO to handle persistance. My person DAO has a getById() function which takes a uuid and returns a cfc of type personObj.
 
I now want a new object 'employee' so I create an employeeObj which extends person, and to handle the persistance I create a employeeDAO which extends personDAO. employee DAO also has a getById() function which takes a uuid and should return a cfc of type employeeObj.
 
My employeeDAO.getById() function is causing me problems. I am trying to call super.getById() but this returns an object of type personObj rather than employeeObj.
 
How can I leverage the DAO code I have written in the parent object?
 
John
 
 


To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. ----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to cfcdev@cfczone.org 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/cfcdev@cfczone.org
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to cfcdev@cfczone.org 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/cfcdev@cfczone.org

Reply via email to