0% found this document useful (0 votes)
13 views

UML Part1

Uploaded by

Sojal Agrawal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

UML Part1

Uploaded by

Sojal Agrawal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

OO Design: UML Diagrams

 UML is a way of visualizing a software program using a collection of


diagrams.
 The notation has evolved from the work of Grady Booch, James
Rumbaugh, Ivar Jacobson, and the Rational Software Corporation to
be used for object-oriented design.
 It extended to cover a wider variety of software engineering projects.
 Today, UML is accepted by the Object Management Group (OMG) as
the standard for modeling software development.
 UML stands for Unified Modeling Language.
 It is used to define a hierarchy and decompose a software system into
components and sub-components.
History of UML
Types of UML Diagram
Structural UML diagrams : Captures the static aspects or structure of a
system.
These are:
 Component Diagrams
 Object Diagrams
 Class Diagrams
 Deployment Diagrams

There are seven kinds of structural things: Class, Interface,


Collaboration, Use Case, Active Class, Component, and Node.
Behavior Diagrams – Capture dynamic aspects or behavior of the
system.

• Use Case Diagrams,


• State Diagrams,
• Activity Diagrams
• Interaction Diagrams.
Static aspect Dynamic aspects

It refers to the properties of It describes how the system


the system being modeled changes while it executes

It does not involve system's It involves system's run time


behavior while execution behavior

It is easier to model It is harder to model


hierarchy of diagrams according to UML 2.2( 15 diagrams)
• Originally UML specified 9 diagrams.
• UML 2.x has increased the number of diagrams from 9 to 15 and
further it is extending.
UML diagrams

• 1. Use Case diagram: External interaction with actors

 2. & 3. Class and Object Diagram : captures static structural


aspects, objects and relationships.

 4. State Diagram: Dynamic state behavior

 5. Sequence diagram: models object interaction over time

 6. Collaboration diagram: models component interaction and


structural dependencies

Software Engineering 10
More UML diagrams

• 7. Activity diagram : models object workflow of activities

 8. Deployment diagram : models physical architecture

 9. Component diagram : models software architecture

Software Engineering 11
1. Class Diagram
• Class diagrams are the most common diagrams used in UML. Class
diagram consists of classes, interfaces, associations, and
collaboration.
• Class diagrams basically represent the object-oriented view of a
system, which is static in nature.
• This is the most widely used diagram at the time of system
construction.
+ denotes public attributes or operations
- denotes private attributes or operations
# denotes protected attributes or operations
~ denotes package attributes or operations
Multiplicity Association
Aggregation Composition
• Objects of Class2 live and die with Class1.
• It represents a "part of" relationship. • Class2 cannot stand by itself.
• Class2 is part of Class1.
• Many instances (denoted by the *) of Class2
can be associated with Class1.
Dependency: Relationship Names
• Exists between two classes if the • Names of relationships are
changes to the definition of one may written in the middle of the
cause changes to the other (but not association line
the other way around).
• Class1 depends on Class2
Class diagram
Generalization ( Inheritance ): bottom to up
Specialization ( up to bottom)

• specialization means creating new subclasses from an existing class. If

it turns out that certain attributes, associations, or methods only

apply to some of the objects of the class, a subclass can be created.


upcasting & down casting in OOPS
2.Use Case Diagram:
Use case diagrams describe the functionality of a system and users of
the system. They contain the following elements:

1. Actors , which represent users of a system, including human users


and other systems.

2. Use cases , which represent functionality or services provided by a


system to users.
Use-Case Diagram
(e.g. insurance system)

Software Engineering 26
Active and Passive Users
the Visa Card Holder and Bank Customer are Primary Actors, while the Visa AS and Bank IS are
secondary actors.
There is another way to classify actors, they can be:
• Human
• Systems / Software
• Hardware
• Timer / Clock
• Use Cases are system functionalities that a system should perform in
collaboration with one or more external users of the system (actors).
• Each use case should provide some observable and valuable results to
the actors or other stakeholders of the system.
Generalization & Specialization
Association, Aggregation,
Composition
Showing dependency

You might also like