Hi, I have an object can be compose by components but each components has a type and should be unique :
Class Client{
Set<IComposite> elements
}
interface IComposite{
String getType();
}
class Status implements IComposite{
String getType(){return "status"}
}
class ClientDates implements IComposite{
String getType(){return "clientdate"}
}
So I suppose I could encapsulate the collection but each element should be unique, so only 1 status, only one clentdate, but perhaps can I create a new Composite class that could be multiple.
An idea how to design that ?
Thanks a lot