13.07.2015 Views

Bouml reference manual - Fedora Project Packages GIT repositories

Bouml reference manual - Fedora Project Packages GIT repositories

Bouml reference manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

file:///C:/uml/BOUML/bouml_3.0/doc/TOUT.html71 of 378 07/10/2007 15:55RelationWe consider in this chapter only the relations between classes. To add a relation to a class you have to use a class diagram (obviousdiagram or the relation drawing may be deleted just after !), it is not possible to add a relation through the browser. It is also not possibleto move a relation into an other class or elsewhere.The icon in the browser indicates if the relation is public (+), protected (#), private (-) or package (~). The protected and packagevisibilities are translated in private in Idl. The package visibility is translated in private in C++, and doesn't produce a visibility in Php(use this case to produce Php 4 code). A class relation is underlined.A bi-directional relation is supported by two relation items in the browser.A relation have a name, a stereotype, may have one or two roles and multiplicity (one by direction). Note that it is not possible to specifya stereotype for each direction of a bi directional relation, frankly I avow that the main reason is to simplify as it is possible the drawingof the relations in the diagrams with the associated labels.In the browser are written the name of the relations (by default its kind) between parenthesis, the role(s) of the associations anaggregations, the end class of the generalization, realization and dependency. The stereotype may be may be showed/hidden through theMiscellaneous menu. The name of a relation is not used by the code generators.Generally the relation's stereotype is used to specify how a relation with a multiplicity?different than 1 is translated in each languaginstance to produce a vector. The friend stereotype is a special case for a dependency and is used to produce a C++ friend declaration.There are several kinds of relation :generalization : to produce an inheritancerealization : produce also an inheritance, the code generators do not distinguish a realization and a generalization.dependency : only the dependency having the stereotype friend are considered by the C++ code generator.unidirectionalassociation: to define a directional relation, the code generators will produce an attribute having the role name. In C++ the default generatedcode use pointer(s).directional aggregation : to define a directional relation, the code generators do not distinguish association and aggregation.directional aggregation by value: to define a directional composition, the code generators will produce an attribute having the role name. In C++ the defaultgenerated code does not use pointer(s).association : to define a bi-directional relation, the code generators will produce two attributes whose names are the roles's name.aggregation: to define a bi-directional aggregation, the code generators will produce two attributes whose names are the roles's name. This kindof relation may considered to be a shortcut to define two (directional) aggregations.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!