Hi,
Rose 98 does not give this warning, or else we would have noticed it from
the beginning (imagine 40 code generation warning on a class generation). We
are migrating our Rose 98 model files to Rose 2001, this is why I can be
sure a warning has appeared since Rose 98.
Aggregation is the whole/part notion, whereas composition is a stronger kind
of aggregation, meaning the composer controls the life cycle of the
composee. In any case, there is no obligation to use by-value or reference
specifically for these two containments. It is an implementation choice
(although by-value containment is always a composition since the containee
is created along with the container).
Regards
Mathieu Girard
-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Envoye : vendredi 9 mars 2001 08:55
A : [EMAIL PROTECTED]
Objet : Re: (ROSE) C++ By-value aggregation warning
Hi,
older versions of Rose give this Warning, too. For me it is what I want
because the generated code wouldn't compile.
IMHO the aggregating class is always responsible for creation
and destruction of its aggregates. What you described is a by-reference
aggregation to me for which Rose generates C++ pointers.
Regards
Michael Seibt
Mathieu Girard wrote:
>
> Hi all,
>
> We are currently evaluating Rose C++ 2001, trying to recover the model
from
> Rose C++ 98. Everything seems to work fine, except for the C++ code
> generation of by-value aggregations. When generating the code, we get this
> brand new message:
>
> <<
> Warning: !!! Class "A" has a forward reference to "B"
> and it also has a by-value containment of "B."
> >>
>
> I think there is a misunderstanding from Rational, which has qualified
> "composition" (which means life-cycle control to me) as "by-value"
> containment, since the begining of Rose. If a class A composes a class B
for
> UML, it is perfectly logical (to me) to compose it with a C++ pointer,
> provided A is in charge of creation/destruction of B. I think Rational got
> mixed-up between logical and physical modelling of composition.
>
> To me, it seems perfectly normal to have a forward declaration of class B
in
> the header A.h , defining a C++ pointer to B in the definition of class A,
> include the header file B.h in the source file A.cpp, and manage the
> allocation/deletion of the instance of B in the source file A.cpp.
> Obviously, Rose 2001 objects to this, and a new warning has been added.
>
> Does anyone of you know how to disable this warning? I have parsed the
> option tabs of Rose, and could not find anything to get rid of it...
>
> Regards,
>
> Mathieu
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************