UML (Unified Modeling Language) is a diagramming language used for object-oriented programming. It can be used to describe how a program is organized, how it executes, how it is used, and how it is deployed over a network. UML uses graphical notation to depict a system, which is clearer than natural language and more overall than code. There are different types of UML diagrams, including class, component, use case, sequence, and state machine diagrams. A class diagram specifically shows classes, interfaces, attributes, operations and relationships.
2. What is UML?
? UML stands for Unified Modeling Language
? UML is a diagramming language designed for Object-
Oriented programming
? UML can be describe:
? the organization of a program
? how a program executes
? how a program is used
? how a program is deployed over a network
? …and more
3. Why we use UML?
? Use graphical notation: more clearly than natural language
(imprecise) and code (too detailed).
? Help acquire an overall view of a system.
? UML is not dependent on any one language or technology.
? UML moves us from breakup to standardization.
4. Types of UML
? Class diagram
? Component diagram
? Development diagram
? Object diagram
? Package diagram
? Profile diagram
? Composite structure diagram
? Use case diagram
? Activity diagram
? State machine diagram
? Sequence diagram
? Communication diagram
? Interaction overview diagram
? Timing diagram
5. Class Diagram
? A class diagram shows classes, interfaces, and their
relationships
? It shows the classes in a system, attributes and operations of
each class and the relationship between each class.
ClassName
attributes
operations
6. Class Name
? The name of the class is the
only required tag in the
graphical representation of a
class.
? It always appears in the top-
most compartment.
ClassName
attributes
operations
7. Class Attributes
? An attribute is a named property
of a class that describes the object
being modeled. In the class
diagram, attributes appear in the
second compartment just below
the name-compartment.
Person
name :
address :
Birthdate :
8. Class Attributes (Cont’d)
? Attributes are usually listed in the
form:
? attributeName : Type
Person
name : string
address : string
birthdate : int
9. Class Attributes (Cont’d)
? Attributes can be:
? + public
? # protected
? - private
Person
+ name : string
-address : string
#birthdate : int
10. Class Operations
? Operations describe the class
behavior
? and appear in the third
compartment.
Person
name : string
address : string
birthdate : int
+Eat():void
+Sleep():void
+Work():void
+Play():void