Class Diagram
Access Specifiers
- + Public
- # Protected
- – Private
- Underline static
- italics abstract
Static
Underlining a variable or method of a class specifies it as static
Abstract Class/Method
A method without body, in a class, is referred to as an abstract method. A class with at least one abstract method is treated as an abstract class. Client objects may not instantiate an abstract class. A subclass of an abstract class must implement all abstract methods of the abstract class or be declared as an abstract class itself. Displaying a class/method name in italics specifies it as an abstract class/method.
Exception
A dashed arrow with a stereotype label “throws” is used to indicate that a specific method throws an exception.
Note
A note is attached to a UML diagram to provide additional information for asymbol such as comments, constraints or code. In general, notes can be attached to any diagram element in any UML diagram. A note is denoted by a dog-eared rectangle and is attached to a diagram element by a dotted line.
Generalization
Generalization is used to depict the object-oriented concept of inheritance when there is a base class with common behavior and each of its derived classes contains specific details/behavior.
Interface
An interface specifies the externally visible operations of a class, but not the actua implementation of those operations. An interface often specifies only a part of the behavior of an actual implementer class.An interface can be drawn using a class-like rectangular setup, with the text “interface” above the name of the interface.
Realization
A realization depicts the relationship between an interface and a class that provides the actual implementation. This can be drawn in two ways depending on how the interface is depicted.
- Using a closed, hollow arrowhead pointing from the implementing classto the interface with a dashed line
- With a line and a circle, where the circle represents the interface (with thename of the interface kept near the circle) and the line can be drawnpointing to the class that implements the interface represented by the circle.
Dependency
A dependency depicts the relationship between a source and a target component, when there is a dependency relationship between the two. It means, when there is a change in the target, the source element undergoes a necessary change but not vice versa.
No comments:
Post a Comment