I have seen a class has "is a" and "has a" relationship with one class. Is that a correct design? If it is correct, let me know the advantage of that design? On what scenario, we need to use this design?
The skeleton of the code :
Class A
{
public void doSomeAction() {}
}
Class B extends A
{
private A obj;
public void doSomeAction()
{
obj.doSomeAction();
}
}
This post has been edited by Thennam Pandian: 28 August 2011 - 09:14 PM











