The Unified Modeling Language (UML) is a graphical language used for visualizing, specifying, constructing, and documenting software systems, akin to blueprints for buildings. It includes various diagrams such as Use Case, Activity, Class, Sequence, and Deployment diagrams that help teams understand system behavior, structure, and interactions. UML facilitates clear communication among developers, designers, and business teams, ensuring everyone has a shared understanding before development begins.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
19 views56 pages
UML Diagrams
The Unified Modeling Language (UML) is a graphical language used for visualizing, specifying, constructing, and documenting software systems, akin to blueprints for buildings. It includes various diagrams such as Use Case, Activity, Class, Sequence, and Deployment diagrams that help teams understand system behavior, structure, and interactions. UML facilitates clear communication among developers, designers, and business teams, ensuring everyone has a shared understanding before development begins.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56
Unified Modeling Language
Prepared by: Charles Ethan Chua
What is it? • The Unified Modeling Language (UML) is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system. • UML (Unified Modeling Language) is a visual way to design and explain how a software system works. Think of it like a blueprint for building software — just like how architects use blueprints to plan buildings. Additionally • With UML, you can show: • Concepts like business processes and how the system should behave. • Technical details like the code structure, database design, and reusable parts of the software. • It helps everyone involved — developers, designers, and business teams — understand the system clearly before building it. Common UML Diagrams • Use Case Diagram • Activity Diagram • Sequence Diagram • Class Diagram • Deployment Diagram Use Case Diagrams What are Actors? • An actor represents a role of a user that interacts with the system that you are modeling. • The user can be a person, an organization, a machine, or another external system. What are Use Cases? • Use cases specify the expected behavior (what), and not the exact method of making it happen (how). • A use case diagram is usually simple. It does not show the detail of the use cases: • It only summarizes some of the relationships between use cases, actors, and systems. • It does not show the order in which steps are performed to achieve the goals of each use case. Additionally • In models that depict businesses, use cases represent the processes and activities of the business. In models that depict software systems, use cases represent the capabilities of the software. • Each use case must have a unique name that describes the action that the system performs. • Use case names are often short phrases that start with a verb, such as Place Order Online. Communication Line/Interaction/Relationship • The participation of an actor in a use case is shown by connecting an actor to a use case by a solid link. • Actors may be connected to use cases by associations, indicating that the actor and the use case communicate with one another using messages. Extend and Include • Extend • The extend relationship extends the base use case and adds more functionality to the system. It is optional but meaningful and independent. It must not rely on the behavior of the extending use case. • Include • The base use case will be incomplete without the included use case. It is mandatory and not optional. Activity Diagram What is it? • Provides a view of the behavior of a system by describing the sequence of actions in a process. • An activity diagram is essentially an advanced version of a flowchart that models the flow from one activity to another activity. An Activity Diagram Notations • Activity – Group of actions that can be broken down Notations • Action – a task to be performed
• Control Flows - Show the flow of an object from one activity (or action) to another activity (or action). Notations • Initial Node / Start
• Final Node / End
Notations • Conditional/Decision – Indicates that an action can take two or different paths Notations • Fork - indicates that two or more steps in the workflow may be completed in parallel. Notations • Join - Bring back together a set of parallel or concurrent flows of activities (or actions). Notations • Swimlanes/Partitions - A way to group activities performed by the same actor on an activity diagram or to group activities in a single thread Another Activity Diagram An Activity Diagram Class Diagram Class Diagrams • Class diagrams provide a high-level overview of a system’s design, helping to communicate and document the structure of the software. • In these diagrams, classes are depicted as boxes, each containing three compartments for the class name, attributes, and methods. Lines connecting classes illustrate associations, showing relationships such as one-to-one or one-to-many. Structure of a Class Diagram Class Name – Name of the Class Attributes – Characteristics of a Class Operations/Methods – What the Class can do Signatures – Data type and parameters of a class Attribute Notations Public (+): Any object can access and modify this attribute. Protected (#): Only the class itself and its subclasses can access and modify this attribute. Private (-): Only the class itself can access and modify this attribute. Perspectives of a Class Diagram A diagram can be interpreted from various perspectives: • Conceptual: represents the concepts in the domain • Specification: focus is on the interfaces of Abstract Data Type (ADTs) in the software • Implementation: describes how classes will implement their interfaces Relationships in Class Diagrams Inheritance • Represents an "is-a" relationship. • An abstract class name is shown in italics. A subclass is a type of the superclass, inheriting all its attributes and methods, and can add new ones specific to itself. Cardinality and Multiplicity Refers to the relationship between two classes, specifying how many instances of one class can be linked to how many instances of another class
• One-to-one: A person can have only
one passport, and a passport belongs to only one person. • One-to-many: A customer can place multiple orders, but each order belongs to only one customer. • Many-to-many: A student can enroll in multiple courses, and a course can have many students. Example Another example Sequence Diagram What are Sequence Diagrams? • A sequence diagram shows how different parts of a system talk to each other over time • It focuses on the order of the steps — like who does an action, who receives it, and what happens next • Think of it as a conversation timeline for a system, this also helps to see the flow of actions or processes An Example Actors/External Actors An actor in a UML diagram represents a type of role where it interacts with the system and its objects. An actor is always outside the scope of the system They can be: A person (Customers), An external system (APIs or Payment Gateways) A device (Printer, sensors) Lifelines A lifeline in a sequence diagram shows a specific part of the system taking part in the interaction Lifelines Each lifeline represents one participant and shows what they do over time. It’s drawn at the top of the diagram, and messages are sent between lifelines A lifeline always portrays an object internal to the system whereas actors are used to depict objects external to the system Messages Communication between objects is depicted using messages. The messages appear in a sequential order on the lifeline. • We represent messages using arrows. • Lifelines and messages form the core of a sequence diagram. Synchronous Messages A synchronous message waits for a reply before the interaction can move forward The sender waits until the receiver has completed the processing of the message We use a solid arrowhead to represent a synchronous message. Asynchronous Messages An asynchronous message does not wait for a reply from the receiver. The interaction moves forward irrespective of the receiver processing the previous message or not. We use a lined arrowhead to represent an asynchronous message. Guards They are used when we need to restrict the flow of messages on the pretext of a condition being met Mainly used for conditions Alt Fragment The alt notation in a sequence diagram is like an if-else statement in programming. It shows a decision with two or more possible paths, but only one path happens based on a condition. Alt Fragment The alt section of this diagram means that the user can decide/choose their payment method (Credit Card or through Paypal) Each option proceeds on their respective process. The system then process their mode of payment Loop fragment A loop fragment in a sequence diagram shows something that happens over and over It’s used when an action repeats multiple times until a condition is met. Loop fragment In the example given, the loop fragment in the example means that whenever a cashier enters an item the system retrieves its description and price. Once the cashier is finished entering items the condition is met and the loop is finished, it will then proceed with the following processes (End sale and etc.) Deployment Diagram Deployment Diagram • A deployment diagram shows how a system’s software runs on hardware — it’s like a map of the system’s physical setup. Nodes Nodes are hardware like servers, personal computers, or any other physical devices Nodes can be connected by communication paths to describe network structures. Nodes can contain other nodes, called nested nodes, and they can also have artifacts deployed on them. Artifacts Artifacts represent physical implementation units, such as executable files, libraries, software components, documents, and databases. Artifacts represent physical implementation units, such as executable files, libraries, software components, documents, and databases. Communication To interpret communications, we use solid lines show how different parts of the system exchange information Like how devices, servers, and software components talk to each other. Interpreting the example Nodes/Hardware: Web Server, DB Server, UserClient and Browser Artifacts/Software: Website, MySQL Database, HTML5 Communication Protocols used: https:80 Interpreting the example How they interact with one another: The user’s browser nodes sends a request to the web server node using the https protocol. Then the web server node retrieves data from the database server node and its respective artifact (MySQL DB). After data retrieval the response is sent back (Website) to the user’s browser.