DAO and Inheritance

Hi,I have 2 objects that the first is extends the second. should i consider any thing in their DAO class or their DAO are distinct?tx
[154 byte] By [Sarah_Mahdavia] at [2007-10-2 20:54:00]
# 1

> Hi,

> I have 2 objects that the first is extends the

> second. should i consider any thing in their DAO

> class or their DAO are distinct?

> tx

Let me see if I undertood well. You have a class that extends other, I can guess that these two classes are composing a bussiness layer, right? and you wanna know if both should use the same DAO class? if so, I don't think you must use only the same DAO classes but any DAO class you want/need.

Hope have helped anyway.

lDoRiLeOa at 2007-7-13 23:38:26 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

thanks for your consideration.

I'm using "Transfer Object", "Business Object" and "Data Access Object" patterns. all are in business tier and my DAO objects should generate my TO objects. but i don't know how should i handle the relationship in DAO classes when one TO class extends another TO class.as i know there are two options in data model for me. 1- one table for both classes and nullable fields 2- two table with a foreign key. but how could i map these concepts to my DAO calss design?

Regards

Sarah_Mahdavia at 2007-7-13 23:38:26 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
If you are using one table use one DAO else use two DAOs.
ssv45324a at 2007-7-13 23:38:26 > top of Java-index,Other Topics,Patterns & OO Design...