I want to represent the following case using UML class diagram:
- a class A that has some elements of C
- a class B that is a subclass of A that contain 1 element of D that is subclass of C
Something like:
Basically (in my mind), the class A has a collection of C but the subclass B only allows (at maximum) one element in that collection that should be instance of D.
What is the best way of representing it?