In UML diagrams, you can add, delete, show, hide, and sort attributes and operations in classifiers to determine how they are displayed and to define the properties and behavior of the classifiers to which they belong.
You can use the Model Explorer view and the diagram editor to manage the attributes and operations that are associated with model elements in your models and diagrams.
The Model Explorer view uses a hierarchical tree to show all the models and elements (including UML models stored in non-modeling projects, such as, Java™, EJB, and C++ projects) in your workspace. You can use the Model Explorer view to visualize these elements in UML diagrams and to facilitate the conversion of your models into code and your code into models.
The diagram editor is the drawing surface for the diagrams in your models. The editor displays model elements, including relationships, geometric shapes, text, notes, and so on, that are in named diagrams.
You can specify the properties, characteristics, and behaviors that are associated with classifiers, such as classes, as you design and develop your models. The diagram editor displays the collection of classifiers that belong to a specific diagram type, such as a class diagram. When you add attributes and operations to a class, the diagram editor shows the attribute and operation compartments and their contents graphically in a UML class shape. When you perform the same tasks in the Model Explorer view, the attributes and operations that are attached to their associated class, become part of the Model Explorer view’s hierarchical representation of your model.
Adding attributes to classifiers in diagrams
In UML diagrams, you can add attributes to classifiers to specify classifier properties.Adding operations to classifiers in diagrams
In UML diagrams, you can add operations to classifiers to show the behavior of the classifier or the service that it provides.Showing or hiding the compartments in classifiers
In UML diagrams, you can specify whether or not to display the compartments in classifiers. You can choose to display all of the compartments in a classifier or display only selected compartments.Sorting and filtering specific attributes and operations
In UML diagrams, you can sort and filter the display of attributes and operations in classifiers to reduce the complexity or increase the abstraction level of your diagrams.Specifying operations as queries
In UML diagrams, operations that function as queries provide ways to observe the state of a system. You can specify that an operation is a query if it returns a value, but does not change the state of a system.
Parent topic: Modeling static structure by using class diagrams
Related concepts
Attributes
Operations