Since I know Java doesn't support multiple inheritance, I'd like to know how could I implement this design in Java:
Class StudentModel extends BaseModel{
public void doSomething(){};
}
Class ParentModel{
protected List<BaseModel> children = new List<BaseModel>();
public void addChild(BaseModel child){
children.add(child);
}
// and other parent-children related functionality
}
Class ConcreteParentModel{
// should contain both StudentModel and ParentModel functionalily
}
Thanks!
implementmultiple interfaces, but onlyextenda single class.ConcreteParentModelhave a parent and a student and have wrapper methods that pass the call to the appropriate instance variable.