M
Mark
Hi I was wondering if anyone could help me with the best approach for
the following.
I have an class called say BigClass with lots of bits and pieces in
it.
I currently have a data access object BigClassGetter which returns a
new populated BigClass object. Now I create a class BiggerClass which
inherits from BigClass with the addition of some other bits of info. So
what I want to do in terms of data access is to use BigClassGetter to
get the BigClass and then just add on the extra information for
BiggerClass.
My problem is BigClassGetter obviously returns BigClass so how can I
create an instance of BiggerClass from that. Sort of cast BigClass up
to BiggerClass. I was thinking of passing BigClass as a constructor to
BiggerClass and copying the info within that but I get the feeling
thats wrong.
Can anyone poing me in the right direction in terms of how to approach
the problem? Should my data access routines lie within the classes
themselves???
the following.
I have an class called say BigClass with lots of bits and pieces in
it.
I currently have a data access object BigClassGetter which returns a
new populated BigClass object. Now I create a class BiggerClass which
inherits from BigClass with the addition of some other bits of info. So
what I want to do in terms of data access is to use BigClassGetter to
get the BigClass and then just add on the extra information for
BiggerClass.
My problem is BigClassGetter obviously returns BigClass so how can I
create an instance of BiggerClass from that. Sort of cast BigClass up
to BiggerClass. I was thinking of passing BigClass as a constructor to
BiggerClass and copying the info within that but I get the feeling
thats wrong.
Can anyone poing me in the right direction in terms of how to approach
the problem? Should my data access routines lie within the classes
themselves???