...
I think you need to back up a level and tell us the problem you are
trying to solve with this structure.
Patricia
>> Hi,
>>
[quoted text clipped - 7 lines]
>
> Patricia
We have two stand alone Java classes. Each is working fine now. Similar
like this:
public Sub {
ChildA person = new ChildA();
person.doA();
}
public Sub2 {
ChildB person = new ChildB();
person.doB();
}
Now, we hope to refactor the code. We see Sub and Sub2 have something in
common and want to extract these common things and put them in an
abstract class Base. But doA() is only available for ChildA, doB() is
only available for ChildB. My boss gave me the layout:
public abstract Base {
protected Person _person;
...
}
public Sub extends Base {
_person = new ChildA();
_person.doA(); //WRONG !!!! error message: doA() is unresolved
}
public Sub2 extends Base {
_person = new ChildB();
_person.doB(); //also wrong!!!
}
After I finished the code, I just found out the errors. This is what I
am asking for the newsgroup.
Lew - 23 May 2007 15:50 GMT
> My boss gave me the layout:
>
[quoted text clipped - 16 lines]
>
> }
Your boss should learn Java before giving advice on it.

Signature
Lew
Mark Space - 23 May 2007 20:08 GMT
> like this:
>
[quoted text clipped - 9 lines]
> person.doB();
> }
Clean, simple and effective!
> My boss gave me the layout:
Your co-workers aren't named Wally and Dilbert by any chance, are they?