[Uml-user] UML question

mark verlinden mverlinden at yahoo.com
Thu Dec 19 01:14:02 UTC 2002


Hi Mark,

On Wednesday 18 December 2002 15:03, mark verlinden wrote:
> When I use aggregations or compositions and I generate code from it I get
> classes containing objects, where I wanted pointers?
>
> class CClassA{
> private:
>    CClassB classB;  -> I need CClassB* classB;
> public:
> };
>
> Is this possible in umbrello?

>Aggregations get written (in C++) as pointers, while Compositions are Objects.
(this is to reflect the fact that the composition relationship is really 
strong, and the "parts" cannot live wihtout the "whole")

Maybe it would be a good idea to add this as an option (as other people have 
said) but since this is only for C++ we would have to think of a clean way to 
do this (global options Vs. language specifics)
but for now I think the current behavior is ok. (pointers for aggregations and 
objects for compositions)

> How about constraints?

there's no support for constraints.
if you know about java and C++ (and how to mix them) you could help us there 
(there is a project for OCL, but it's written in Java). Otherwise we will 
have to implement it all ourselves, but I don't know when we'll get to it.

regards

luis

Hi,

the point is when I use list<Object> I want a list<Object*> from an STL point of view. Otherwise
I need to program a copy constructor for the container list.
When I have a pointer declaration in my class I might look like an aggregation because of
it isn't part of the whole, but when I create the object for this pointer within the class
it has become a part of the class and seems to me that's a composition. Because this part will
not live without the whole.

Are packages within packages possible, this would be a nice feature though!?

PS: Great application , Umbrello!

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com




More information about the umbrello mailing list