I am currently designing a software and I am not sure about the below design I came up with whether it is a maintainable, extensible and decoupled design.
public interface IDrawable
{
}
public interface IComponent: IDrawable
{
}
public interface IContainable : IDrawable
{
IEnumerable<IDrawable> Children { get;} <--this property takes collection of high level interface
}
IComponent
can be such as TextComponent
and ImageComponent
.
IContainable
can have childrens of either IContainable
or IComponent
hence collection of IDrawable
..
So question is, Is it okay for IContainable
to have property of its implemented IDrawable
interface?
Aucun commentaire:
Enregistrer un commentaire