David Olsen <[EMAIL PROTECTED]>@rational.com on 03/09/2001 07:11:18 PM

Please respond to David Olsen <[EMAIL PROTECTED]>

Sent by:  [EMAIL PROTECTED]


To:   [EMAIL PROTECTED], [EMAIL PROTECTED]
cc:

Subject:  Re: (ROSE) Problems with the ANSI C++ classes



[EMAIL PROTECTED] wrote:

> Now I am trying to migrate some C++ classes to ANSI C++ classes. Even the
ANSI C++ offers a good
> solution for the rounding trip I see the following drawbacks:
>
> 1. A component has to be defined for every class.

A component can have many classes assigned to it and many source files
associated with it.  Having one component per class is strongly
discouraged.

I don't think so. If you have classes that have some relation between them,
ok, but otherwise I don't see the problem (for large scale software yes,
but not for medium size). If you take a look to a lot of C++ programming
guidelines sometimes they recomend that.

Why I don't understand is why Rational Rose, offers a good solution for
rounding trip but loosing all the flexibility of the former C++ class type.

*****************************************************************************
Why to offer a good rounding trip feature for a very specific type of class
only?
*****************************************************************************

> 2. Some setting have to be done from the file, for example to set a
method as virtual or constant, etc.

>> Many things that were properties in classic C++ are now stereotypes in
>> ANSI C++.  To make an operation virtual, set its stereotype to
>> <<virtual>>.  To make it const, set its stereotype to <<const>>.

but some of them are not UML standard and also it is not possible to
agrupate items by stereotypes which is more readable. In UML it is possible
but as far as I know Rose doesn't, for example something like this:

<<const>>
get_A
get_B
<<virtual>>
fooA
fooB

instead of:

<<const>> get_A
<<const>> get_B
<<virtual>> fooA
<<virtual>> fooB

>>The stereotypes that ANSI C++ recognizes and treats specially are: (This
>>is from memory, so I may be missing one or two)

>>Classes: struct, union, enum, typedef
>>Attributes: mutable
>>Operations: virtual, abstract, const, static, friend, explicit

Ok and what happen if you use two at the same time? let say virtual and
explicit or virtual and const?

> 3. When you delete an attribute the get and set are not deleted,
> automatically.

>>True.  Classic C++ used properties to cause the generation of certain
>>member functions in the code.  ANSI C++ does not have such properties.
>>Instead, those member functions are explicitly modeled as operations in
>>the model.  One side effect of that is that the link between an
>>attribute and its get and set operations is lost.  Ways of maintaining
>>that link are being considered, but no solution is currently available.

BUT THE DOCUMENTATION SAYS THAT:

********************************************************************************Rose

ANSI C++ is the newest member of the family of Rose language add-ins. It is
designed to be powerful enough to handle large projects with particular
emphasis on scalability and completeness of language support. The user
interface has been completely redesigned to make the add-in easy to
understand and use. Rose ANSI C++ features not in Rose C++ are:
.......................

********************************************************************************

Do you think that to lose the link between the attribute and its accessors
and modifiers will help some one to develop large projects with the
particular emphasis on scalability as the documentation says?

> 4. I don't see the way to configure the class diagram to don't see
obvious information, such as:
> get and set of the attributes, default constructors, etc. The design if
for showing relevant information
> of the class!!!. If the default behavior show all this information then
you will get a design with a lot of irrelevant
> information. (it will be not readable!)

>>You can choose exactly which attributes and operations you want to be
>>listed on a class diagram.  Right click on the class on the diagram, and
>>under the Options submenu, make sure "Show All Attributes" and "Show All
>>Operations" are unselected, then select "Select Compartment Items...".

Ok!, but then you have to clik a lot!!!! in Rational Rose you have a lot of
cliking!

In my opinion it is a design error of the new ANSI C++ property. You can
fix the style of the braces, but you can not fix what to see on the class
diagram!!!!!, it is simply crazy!!!!!


>>Unfortunately, this can only be done from the GUI one class at a time.
>>There is no way to tell Rose that a certain operation should not be
>>shown by default in any class diagram.

Ok, but some properties such as the brace style could be fixed for more
than one class but in the oposite way other staff concerning more to the
design are not possible to fix.

In my opinion, this type of class was created to attract people that don't
like to design and to take a look to the implementation all the time, to
make a design. It is a good policy for attracting such kind of people but
it loses the main design philosofy it self. There is no need to take in to
the implementation to design!!!

> 5. The namespace declaration is missing.

>>Your problem description isn't very clear.  I assume you mean that
>>namespaces are not showing up when you generate code.

>>If you want a package in the model to correspond to a C++ namespace in
>>the code, then the IsNamespace property on the ANSI C++ tab of the
>>package specification must be set to True.  If it is False (which is the
>>default), then the package is used only for organizational purposes in
>>the model and does not affect the generated code.

>>When reverse engineering, namespaces in the code are always translated
>>into packages in the model with the IsNamespace property set to True.

I did all the steps you have mentioned, but in the generated code you don't
see the namespace declaration:

namespace new{
     class NewClass{
     };
}

I got something like this:

class NewClass{
};


Thanks for your comments,

David

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