What Is UML
What Is UML
• Class Name
• Attributes:Attributes, also known as properties or fields
• Methods, also known as functions or operations- public, private
• Visibility Notation
• + for public (visible to all classes)
• - for private (visible only within the class)
• # for protected (visible to subclasses)
• ~ for package or default visibility (visible to classes in the same
package
• In (Input):
• An input parameter is a parameter passed from the
calling object (client) to the called object (server) during
a method invocation.
• Out (Output):
• An output parameter is a parameter passed from the
called object (server) back to the calling object (client)
after the method execution.
• InOut (Input and Output):
• An InOut parameter serves as both input and output. It
carries information from the calling object to the called
object and vice versa.
How to draw Class Diagrams
• Step 1: Identify Classes:
• Start by identifying the classes in your system. A class represents a blueprint for objects and should encapsulate related attributes
and methods.
• Step 2: List Attributes and Methods:
• For each class, list its attributes (properties, fields) and methods (functions, operations). Include information such as data types and
visibility (public, private, protected).
• Step 3: Identify Relationships:
• Determine the relationships between classes. Common relationships include associations, aggregations, compositions, inheritance,
and dependencies. Understand the nature and multiplicity of these relationships.
• Step 4: Create Class Boxes:
• Draw a rectangle (class box) for each class identified. Place the class name in the top compartment of the box. Divide the box into
compartments for attributes and methods.
• Step 5: Add Attributes and Methods:
• Inside each class box, list the attributes and methods in their respective compartments. Use visibility notations (+ for public, – for
private, # for protected, ~ for package/default).
• Step 6: Draw Relationships:
• Draw lines to represent relationships between classes. Use arrows to indicate the direction of associations or dependencies. Different
line types or notations may be used for various relationships.
• Step 7: Label Relationships:
• Label the relationships with multiplicity and role names if needed. Multiplicity indicates the number of instances involved in the
relationship, and role names clarify the role of each class in the relationship.
• Step 8: Review and Refine:
• Review your class diagram to ensure it accurately represents the system’s structure and relationships. Refine the diagram as needed