Using the default code generation parameters, you should have no problem
generating a by-value aggregation (Rose places a #include "B.h" in A.h).
You must have modified one of the other code gen parameters to force a
forward reference... and that action will conflict with a by-value
aggregation.  




-----Original Message-----
From: Mathieu Girard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 10:05 AM
To: [EMAIL PROTECTED]
Subject: (ROSE) C++ By-value aggregation warning



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
*
*************************************************************************

Reply via email to