Unified Modeling Language (UML)
Unified Modeling Language (UML) is a standardized visual modeling language widely used for designing and documenting software systems. It provides a versatile, flexible, and user-friendly way to visualize a system's architecture and functionality.
Key Features of UML
- Standardized Notation: Ensures consistency and clarity in representing system designs across different teams and stakeholders.
- Versatility: Suitable for modeling a variety of systems, including software, hardware, and business processes.
- Comprehensive Approach: Enables specification, visualization, construction, and documentation of system artifacts.
Why Use UML?
- Behavior and Structure Representation: UML diagrams illustrate both the dynamic behavior and static structure of a system.
- Collaboration Across Stakeholders: UML aids software engineers, business analysts, and system architects in modeling, designing, and analyzing systems collaboratively.
- Improved Design and Analysis: By visualizing the system before development, UML helps identify potential issues early and ensures a robust design.
Applications of UML
- System Design: Create detailed blueprints of software systems.
- Requirement Analysis: Capture and validate functional and non-functional requirements.
- Documentation: Maintain clear records of system architecture for future reference or updates.
Class Notation
Class Notation is a central aspect of Unified Modeling Language (UML) used to visualize, specify, construct, and document the structure of object-oriented systems.
Class Notation Breakdown
- Class Name: Written in the top compartment of the class diagram. Centered and bold to distinguish it clearly. Italics can be used if the class is abstract.
- Attributes: Represent the properties or fields of the class. Listed in the middle compartment of the class box. Syntax:
visibility name: type = defaultValue. - Methods: Represent the operations or behaviors of the class. Listed in the bottom compartment of the class box. Syntax:
visibility name(parameters): returnType. - Visibility Notation: Indicates access levels of attributes and methods:
- + Public: Accessible to all classes.
- - Private: Accessible only within the class.
- # Protected: Accessible to subclasses.
- ~ Package (default): Accessible within the same package.
Example Class Notation
- Student
- id: int = 0
- name: String
- age: int
+ getDetails(): String
+ setName(name: String): void
# calculateGrade(): float
Types of UML Diagrams
UML diagrams are divided into two primary categories: Structural Diagrams and Behavioral Diagrams, representing different aspects of a system's design and functionality.
Structural Diagrams
- Class Diagram: Represents the classes in a system and their relationships (attributes and methods).
- Component Diagram: Shows the organization and dependencies of software components.
- Object Diagram: Provides a snapshot of objects and their states at a specific moment.
- Deployment Diagram: Models the physical deployment of software on hardware nodes.
Behavioral Diagrams
- Use Case Diagram: Illustrates the functional requirements of a system through actors and use cases.
- Sequence Diagram: Depicts the sequence of messages exchanged between objects to achieve a specific task.
- Activity Diagram: Represents workflows or processes through a sequence of activities.
- State Diagram: Shows the states of an object and transitions based on events.
Use Case Diagram
A Use Case Diagram in Unified Modeling Language (UML) visually depicts functional requirements. It shows how various actors interact with specific functionalities (use cases) of the system, providing a clear, high-level overview of the system's behavior.
When to Apply Use Case Diagrams
- Requirement Gathering and Analysis: Ideal for capturing interactions with the system.
- Facilitating Communication: Simplifies complex system interactions for technical and non-technical stakeholders.
- System Design and Validation: Ensures the system aligns with user expectations.
- Scope Definition: Clearly differentiates what is part of the system and what lies outside its scope.
- Documentation: Provides an easy-to-read overview of system functionality.
Use Case Diagram Notations
- Actors: External entities that interact with the system. Represented as stick figures.
- Use Cases: Specific functionalities or actions that the system performs. Represented as ovals.
- System Boundary: Highlights the scope of the system. Represented as a rectangular box surrounding the use cases.
Activities
Activity 01
Scenario Description: A library allows members to search for books, borrow books, and return books. The librarian manages the books in the system, including adding new books, removing old books, and updating book details.
Activity 02
Scenario Description: An ATM allows users to withdraw cash, check their account balance, and deposit funds. The bank system processes these transactions and updates the account balance.