On 2007-10-25 10:13, dev_15 wrote:
> Hi, Sorry just to clarify, in C++ a 'HAS A' relationship is
> implemented with the class having, as a member, another class.
>
> How is a 'USING a' relationship implemented typically
> (not composition or aggregation, say just a
> class using another utility class etc) .
There is no one to one mapping between UML and C++ code, though from a
piece of C++ code one should be able to generate UML diagrams (I am not
100% sure that you can not generate more than one set of diagrams
however). When going the other way (from UML to C++) there is usually a
number of different possible outputs. It is therefore impossible to say
how a UML relationship is "usually" implemented in C++.
Association can be used whenever none of the other relationships does
not fit and possible scenarios might be that an object of a type is
passed as a parameter to a function, or an object is temporarily created
in one of its functions and then discarded when the function returns.
For questions about UML a group discussing UML will give you much better
answers.
--
Erik Wikström
|