UML Modeling Techniques > Class modeling > Ports > Overview of rolling up part and port features
Overview of rolling up part and port features
On a Composite Structure Diagram you can add the following features to a Part or Port: Parts, Ports, Associations and Dependencies to Interfaces. After creating these features in the context of a Part or Port, you may decide that you want to make those features available through the Part's or Port's type (a Class, Data Type, Interface or Signal): you do this by rolling up the features. After rolling up a Part's or Port's features to its type, those features are inherited by any Part or Port that uses the Class, Data Type, Interface or Signal as its type. In addition, after rolling up features to a Class, Data Type, Interface or Signal, those features can be shown on Class Diagrams.
In the following example, we demonstrate how a Part's features are rolled up to its type.
We have three Classes named Bicycle, Wheel and Tire. On a Composite Structure Diagram, we add the Bicycle class to the diagram, create a Part named Front that uses the Wheel class as its type, and then create a Part named tire that uses the Tire class as its type.
You can see that the tire Part has been created in context: The Tire class is not a part of the Wheel class.
We now decide that we want the Tire class to be a part of the Wheel class, so we decide roll up the Front part's features to its type (the Wheel class). We do this by right-clicking the Front part, and then clicking Roll Up Features.
You can see that the Tire class is now part of the Wheel class. The Tire part on the Composite Structure Diagram is now a redefinition, because the Front part inherits the Tire part from its type (the Wheel class). Any Part or Port that uses the Wheel class as its type will now inherit the Tire part.
There are three commands available for rolling up contextual features (Roll Up, Roll Up Features and Roll Up), each demonstrated using the previous example:
Roll Up - For a Part or Port, rolls up that Part or Port to its parent's (Part or Port) type.
Roll Up Features - For a Part or Port, rolls up all its contextual features to its type.
Roll Up Contextual Features - For a Class, Data Type, Interface or Signal, rolls up the contextual features of all Parts and Ports that use that Class, Data Type, Interface or Signal as their type.
The roll up commands are available only if there are contextual features to roll up.