UML Class diagram notation
- name
- attributes (data)
- behavior (messages and operations)
- constraints
- tagged values
- stereotypes
Class is represented by
- A rectangle, with first row as name of the class
- second row has attributes with initial values
- third row with has operations their in parameters, out parameters and return type
- the visibility of the attribute or operation is depicted by
- “-” for private
- “+” for public
- “#” for protected
- “~” for package visibility
Interface
- behavior which is bounded to be given by the implementing class
- interface is common, implementation can differ in implementing classes
- represented by a rectangle, with the first row having Interface name
- second row having the operations, written in italics
- can also be represented by a circle with no details
Associations
- to depict relationship
- connects two classes with roles at each end, cardinality, direction and constraints
- can be of types
- bi-directional
- uni-directional
- association class
- aggregation (basic and composite)
- reflexive association
Instances
- to show examples of the instances of the class (for more clarity)
- shown as a rectangle
- first row having the instance name and class name in one line
- second row has the attribute name and the value for the instance of the class
- you can draw the associations at the instance level to explain with more clarity, but it has to be in conformance with the class diagram (showing same multiplicity and role as in the class diagram)
Reference : www.ibm.com
No comments:
Post a Comment