I created a Class Diagram. This is just a concept but i want to know if the relationship are correct and if i fully understand it.
MainClass
ClassAA
Relationship from ClassAA to ClassBB is this suppose to be a composition? since the classAA is the creator of ClassBB and it depends on it from existing The relation between InterfaceAA and ClassAA is realization. I wasn't able to draw the line using NClass diagram.
ClassAA
and ClassBB
is composition only in case the instance of ClassBB
created by ClassAA
is stored inside ClassAA
and not shared with external entities. In this case it would be good OO practice to hide this implementation detail and perform the necessary initialization inside the ClassAA
's constructor or a dedicated Initialize
method.