I, like Rob, am curious about the exact relationship b/w person and
employee. But as an FYI, I use an abstract class to define a generic
DAO object that implements the public Save, Read, etc methods and
leaves the implementation details of the private functions that
actually do the work up to anyone inheriting from the baseDAO class. I
have not had needed to inherit from a class that implements the
baseDAO, e.g. employeeDAO implements personDAO which implements
baseDAO. I do however have a DAO use another DAO for the 'has-A' type
of relationship. E.g. A Person 'has-an' Address. (Note: Assumption for this example is a person has 1 address) DB has 2 tables, person & address with an addressID in person that is foreign key to address. To help illustrate separation of domain model and database model I'm going use 1 bean object, personObj that contains all the address info, e.g. personObj.getState(), and not create 2 separate bean objects, personObj & addressObj. However I do have 2 DAO's, personDAO & addressDAO use to access table persisted data. The Save method in the personDAO takes personObj. Within the personDAO it would use the addressDAO to do the CRUD work for the address portion of the personObj and the personDAO for the contact portion of the personDAO. So my domain model has a person concept but my db has an address and person table, i.e. the domain and data model are separate. Now, there are tools and frameworks that would and do create bean objects based database table relationships to help speed up development and eliminate hand coding CRUD stuff. So whether you use the bean = table concept or bean = domain which may or may not = table or an automagic framework to deal with it for you is up to you. Personally I'm still undecided on which method is best at this time. -Jason John Samson wrote:
-- Jason Daiger URL: www.jdaiger.com EML: [EMAIL PROTECTED] ---------------------------------------------------------- |
- [CFCDev] DAO Inheritance John Samson
- RE: [CFCDev] DAO Inheritance Ben Nadel
- RE: [CFCDev] DAO Inheritance Rob Munn
- Re: [CFCDev] DAO Inheritance Jason Daiger