John,

 

I am very new to OOP so take this with a grain of salt, but what if you have an abstract or interface class for the two classes (ex. AbstractPersonBean)... and then PersonObj and EmployeeObj would extend that (or employee could extend person i think). Then your return types could be of type AbstractPerson and should not cause any type conflicts...

 

but again... grain of salt.

 

......................

Ben Nadel

Web Developer

Nylon Technology

6 West 14th Street

New York, NY 10011

212.691.1134

212.691.3477 fax

www.nylontechnology.com

 

Programming is my "money" job. My real passion is eating.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Samson
Sent: Tuesday, February 14, 2006 9: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