Say I have two classes. I want to compose class A into class B.
However, for this to be valid, class B must implement a specific set of interfaces required by class A.
How could I associate class A with the list of interfaces it requires class B to implement?
I want to do this so that at run time, some type of controller can decide whether or not to add one object to the other. It will only add a to b if b implements all of the interfaces required by a.
I hope this makes sense! Thanks!
Aucun commentaire:
Enregistrer un commentaire