SlideShare a Scribd company logo
1 of 31
Software Design Class
Diagram
Material based on
[Booch99, Rambaugh99, Jacobson99, Fowler97, Brown99]
Classes
ClassName
attributes
operations
A class is a description of a set of
objects that share the same attributes,
operations, relationships, and semantics.
Graphically, a class is rendered as a
rectangle, usually including its name,
attributes, and operations in separate,
designated compartments.
Class Names
ClassName
attributes
operations
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.
Class Attributes
Person
name : String
address : Address
birthdate : Date
ssn : Id
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.
Class Attributes (Contā€™d)
Person
name : String
address : Address
birthdate : Date
/ age : Date
ssn : Id
Attributes are usually listed in the form:
attributeName : Type
A derived attribute is one that can be
computed from other attributes, but
doesnā€™t actually exist. For example,
a Personā€™s age can be computed from
his birth date. A derived attribute is
designated by a preceding ā€˜/ā€™ as in:
/ age : Date
Class Attributes (Contā€™d)
Person
+ name : String
# address : Address
# birthdate : Date
/ age : Date
- ssn : Id
Attributes can be:
+ public
# protected
- private
/ derived
Class Operations
Person
name : String
address : Address
birthdate : Date
ssn : Id
eat
sleep
work
play
Operations describe the class behavior
and appear in the third compartment.
Class Operations (Contā€™d)
PhoneBook
newEntry (n : Name, a : Address, p : PhoneNumber, d : Description)
getPhone ( n : Name, a : Address) : PhoneNumber
You can specify an operation by stating its signature: listing the
name, type, and default value of all parameters, and, in the case of
functions, a return type.
Depicting Classes
Person
name : String
birthdate : Date
ssn : Id
eat()
sleep()
work()
play()
When drawing a class, you neednā€™t show attributes and operation
in every diagram.
Person
Person
name
address
birthdate
Person
eat
play
Person
Class Responsibilities
A class may also include its responsibilities in a class diagram.
A responsibility is a contract or obligation of a class to
perform a particular service.
SmokeAlarm
Responsibilities
-- sound alert and notify guard station
when smoke is detected.
-- indicate battery state
Relationships
In UML, object interconnections (logical or physical), are
modeled as relationships.
There are three kinds of relationships in UML:
ā€¢ dependencies
ā€¢ generalizations
ā€¢ associations
Dependency Relationships
CourseSchedule
add(c : Course)
remove(c : Course)
Course
A dependency indicates a semantic relationship between two or
more elements. The dependency from CourseSchedule to
Course exists because Course is used in both the add and
remove operations of CourseSchedule.
Generalization Relationships
Person
A generalization connects a subclass
to its superclass. It denotes an
inheritance of attributes and behavior
from the superclass to the subclass and
indicates a specialization in the subclass
of the more general superclass.
Student
Generalization Relationships (Contā€™d)
Student
UML permits a class to inherit from multiple superclasses,
although some programming languages (e.g., Java) do not permit
multiple inheritance.
TeachingAssistant
Employee
Association Relationships
If two classes in a model need to communicate with each other,
there must be link between them.
An association denotes that link.
InstructorStudent
Association Relationships (Contā€™d)
We can indicate the multiplicity of an association by adding
multiplicity adornments to the line denoting the association.
The example indicates that a Student has one or more
Instructors:
InstructorStudent
1..*
Association Relationships (Contā€™d)
The example indicates that every Instructor has one or more
Students:
InstructorStudent
1..*
Association Relationships (Contā€™d)
We can also indicate the behavior of an object in an association
(i.e., the role of an object) using rolenames.
InstructorStudent
1..*1..*
learns fromteaches
Association Relationships (Contā€™d)
We can also name the association.
TeamStudent
membership
1..* 1..*
Association Relationships (Contā€™d)
We can specify dual associations.
TeamStudent
member of
1..*
president of1 1..*
1..*
Association Relationships (Contā€™d)
We can constrain the association relationship by defining the
navigability of the association. Here, a Router object requests
services from a DNS object by sending messages to (invoking
the operations of) the server. The direction of the association
indicates that the server has no knowledge of the Router.
Router DomainNameServer
Association Relationships (Contā€™d)
Associations can also be objects themselves, called link classes
or an association classes.
WarrantyProduct
Registration
modelNumber
serialNumber
warrentyCode
Association Relationships (Contā€™d)
A class can have a self association.
LinkedListNode
next
previous
Association Relationships (Contā€™d)
We can model objects that contain other objects by way of
special associations called aggregations and compositions.
An aggregation specifies a whole-part relationship between
an aggregate (a whole) and a constituent part, where the part
can exist independently from the aggregate. Aggregations are
denoted by a hollow-diamond adornment on the association.
Car
Engine
Transmission
Association Relationships (Contā€™d)
A composition indicates a strong ownership and coincident
lifetime of parts by the whole (i.e., they live and die as a
whole). Compositions are denoted by a filled-diamond
adornment on the association.
Window
Scrollbar
Titlebar
Menu
1
1
1
1
1
1 .. *
Interfaces
An interface is a named set of
operations that specifies the behavior
of objects without showing their inner
structure. It can be rendered in the
model by a one- or two-compartment
rectangle, with the stereotype
<<interface>> above the interface
name.
<<interface>>
ControlPanel
Interface Services
Interfaces do not get instantiated.
They have no attributes or state.
Rather, they specify the services
offered by a related class.
<<interface>>
ControlPanel
getChoices : Choice[]
makeChoice (c : Choice)
getSelection : Selection
Exceptions
<<exception>>
KeyException
<<exception>>
SQLException
<<exception>>
Exception
getMessage()
printStackTrace()
Exceptions can be modeled
just like any other class.
Notice the <<exception>>
stereotype in the name
compartment.
Packages
Compiler
A package is a container-like element
for organizing other elements into
groups.
A package can contain classes and
other packages and diagrams.
Packages can be used to provide
controlled access between classes in
different packages.
Example: Problem Report Tool
ļ¬A CASE tool for storing and tracking
problem reports
ļ‚”Each report contains a problem description and
a status
ļ‚”Each problem can be assigned to someone
ļ‚”Problem reports are made on one of the
ā€œartifactsā€ of a project
ļ‚”Employees are assigned to a project
ļ‚”A manager may add new artifacts and assign
problem reports to team members
Class Diagram for Prob. Rep. Tool
Employee
+name:string
Manager Developer
Project
+name:string
Artifact
+name:string
+status:enum
ProblemReport
HistoryEntry
-when:Date
-whatDone:string
CodeBugReport
1
0..n
ResponsibleFor
0..*
1
1
0..n
About
0..n
1
HistoryLog
1..*
0..*
AssignedTo
1 0..*
ManagedBy

More Related Content

What's hot

Slide 5 Class Diagram
Slide 5 Class DiagramSlide 5 Class Diagram
Slide 5 Class DiagramNiloy Rocker
Ā 
2 class use case
2 class use case2 class use case
2 class use caseMinal Maniar
Ā 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationshipsPooja mittal
Ā 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML DiagramsManish Kumar
Ā 
Relations Class Diagram
Relations Class DiagramRelations Class Diagram
Relations Class Diagramhalwal
Ā 
Class diagram
Class diagramClass diagram
Class diagramSESP123
Ā 
Class diagram- UML diagram
Class diagram- UML diagramClass diagram- UML diagram
Class diagram- UML diagramRamakant Soni
Ā 
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...Niloy Biswas
Ā 
UML Diagram Assignment Help, UML Diagram Homework Help
UML Diagram Assignment Help, UML Diagram Homework HelpUML Diagram Assignment Help, UML Diagram Homework Help
UML Diagram Assignment Help, UML Diagram Homework HelpJacob William
Ā 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentationmewaseem
Ā 
Class diagrams
Class diagramsClass diagrams
Class diagramsVince Carter
Ā 
Class diagrams
Class diagramsClass diagrams
Class diagramsNadia_Nazeer
Ā 
Uml package diagram
Uml package  diagramUml package  diagram
Uml package diagramVedaraj M
Ā 

What's hot (19)

Slide 5 Class Diagram
Slide 5 Class DiagramSlide 5 Class Diagram
Slide 5 Class Diagram
Ā 
Class diagram
Class diagramClass diagram
Class diagram
Ā 
2 class use case
2 class use case2 class use case
2 class use case
Ā 
Class Diagram
Class DiagramClass Diagram
Class Diagram
Ā 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationships
Ā 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
Ā 
Interfaces & Packages V2
Interfaces & Packages V2Interfaces & Packages V2
Interfaces & Packages V2
Ā 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
Ā 
Relations Class Diagram
Relations Class DiagramRelations Class Diagram
Relations Class Diagram
Ā 
Class diagram
Class diagramClass diagram
Class diagram
Ā 
Class diagram- UML diagram
Class diagram- UML diagramClass diagram- UML diagram
Class diagram- UML diagram
Ā 
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
Ā 
UML Diagram Assignment Help, UML Diagram Homework Help
UML Diagram Assignment Help, UML Diagram Homework HelpUML Diagram Assignment Help, UML Diagram Homework Help
UML Diagram Assignment Help, UML Diagram Homework Help
Ā 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
Ā 
Class diagrams
Class diagramsClass diagrams
Class diagrams
Ā 
Class diagrams
Class diagramsClass diagrams
Class diagrams
Ā 
Uml package diagram
Uml package  diagramUml package  diagram
Uml package diagram
Ā 
Uml lecture
Uml lectureUml lecture
Uml lecture
Ā 
34. uml
34. uml34. uml
34. uml
Ā 

Similar to Lecture12 software design class diagram

Descriptions of class diagrams in software
Descriptions of class diagrams in softwareDescriptions of class diagrams in software
Descriptions of class diagrams in softwaressuser9d62d6
Ā 
class Diagram.ppt
class Diagram.pptclass Diagram.ppt
class Diagram.pptusama537223
Ā 
Introduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdfIntroduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdfTARGARYEN001
Ā 
210280107093_CLASS_DIAGRAM.pptx
210280107093_CLASS_DIAGRAM.pptx210280107093_CLASS_DIAGRAM.pptx
210280107093_CLASS_DIAGRAM.pptxHimeshNayi
Ā 
Umldiagram
UmldiagramUmldiagram
Umldiagrampavandeep11
Ā 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering Madhar Khan Pathan
Ā 
Object Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLObject Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLMalek Sumaiya
Ā 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An OverviewRaj Thilak S
Ā 
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejnejeUML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejnejessusera6a60c1
Ā 
UML- Unified Modeling Language
UML- Unified Modeling LanguageUML- Unified Modeling Language
UML- Unified Modeling LanguageShahzad
Ā 
Unified modeling language
Unified modeling languageUnified modeling language
Unified modeling languageamity2j
Ā 
UML, ER and Dimensional Modelling
UML, ER and Dimensional ModellingUML, ER and Dimensional Modelling
UML, ER and Dimensional ModellingStefano Dalla Palma
Ā 
Intro to UML 2
Intro to UML 2Intro to UML 2
Intro to UML 2rchakra
Ā 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagramskebsterz
Ā 
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptxCh.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptxSohagSrz
Ā 

Similar to Lecture12 software design class diagram (20)

Descriptions of class diagrams in software
Descriptions of class diagrams in softwareDescriptions of class diagrams in software
Descriptions of class diagrams in software
Ā 
class Diagram.ppt
class Diagram.pptclass Diagram.ppt
class Diagram.ppt
Ā 
Introduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdfIntroduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdf
Ā 
210280107093_CLASS_DIAGRAM.pptx
210280107093_CLASS_DIAGRAM.pptx210280107093_CLASS_DIAGRAM.pptx
210280107093_CLASS_DIAGRAM.pptx
Ā 
Umldiagram
UmldiagramUmldiagram
Umldiagram
Ā 
Uml report
Uml reportUml report
Uml report
Ā 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
Ā 
Object Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLObject Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UML
Ā 
Css uml
Css umlCss uml
Css uml
Ā 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
Ā 
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejnejeUML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
Ā 
UML- Unified Modeling Language
UML- Unified Modeling LanguageUML- Unified Modeling Language
UML- Unified Modeling Language
Ā 
Unified modeling language
Unified modeling languageUnified modeling language
Unified modeling language
Ā 
Jar chapter 2
Jar chapter 2Jar chapter 2
Jar chapter 2
Ā 
UML, ER and Dimensional Modelling
UML, ER and Dimensional ModellingUML, ER and Dimensional Modelling
UML, ER and Dimensional Modelling
Ā 
Intro Uml
Intro UmlIntro Uml
Intro Uml
Ā 
Intro to UML 2
Intro to UML 2Intro to UML 2
Intro to UML 2
Ā 
Uml
UmlUml
Uml
Ā 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
Ā 
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptxCh.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ā 

More from Shahid Riaz

Shimla deputation (1906)
Shimla deputation (1906)Shimla deputation (1906)
Shimla deputation (1906)Shahid Riaz
Ā 
#Syed ahmad shaheed barailvi
#Syed ahmad shaheed barailvi#Syed ahmad shaheed barailvi
#Syed ahmad shaheed barailviShahid Riaz
Ā 
How to program in c++ with 100 examples
How to program in c++ with 100 examples  How to program in c++ with 100 examples
How to program in c++ with 100 examples Shahid Riaz
Ā 
Virtual private networks in theory and practice
Virtual private networks in theory and practiceVirtual private networks in theory and practice
Virtual private networks in theory and practiceShahid Riaz
Ā 
Database systems administration week 1
Database systems administration week 1Database systems administration week 1
Database systems administration week 1Shahid Riaz
Ā 
Database systems administration traning 02
Database systems administration traning 02Database systems administration traning 02
Database systems administration traning 02Shahid Riaz
Ā 
Database systems administration traning 02
Database systems administration traning 02Database systems administration traning 02
Database systems administration traning 02Shahid Riaz
Ā 
Database systems administration traning 01
Database systems administration traning 01Database systems administration traning 01
Database systems administration traning 01Shahid Riaz
Ā 
Database systems administration traning 0
Database systems administration traning 0Database systems administration traning 0
Database systems administration traning 0Shahid Riaz
Ā 
Database systems administration traning 04
Database systems administration traning  04Database systems administration traning  04
Database systems administration traning 04Shahid Riaz
Ā 
Managing people and organizing team
Managing people and organizing teamManaging people and organizing team
Managing people and organizing teamShahid Riaz
Ā 
Lec 1 intro to internet
Lec 1 intro to internetLec 1 intro to internet
Lec 1 intro to internetShahid Riaz
Ā 
Course guidlines course book it 3548
Course guidlines course book it 3548Course guidlines course book it 3548
Course guidlines course book it 3548Shahid Riaz
Ā 
Lecture11 use case sequence diagram
Lecture11 use case sequence diagramLecture11 use case sequence diagram
Lecture11 use case sequence diagramShahid Riaz
Ā 
Lecture10 use case model operation contracts
Lecture10 use case model operation contractsLecture10 use case model operation contracts
Lecture10 use case model operation contractsShahid Riaz
Ā 
Lecture9 domain model visualizing
Lecture9 domain model visualizingLecture9 domain model visualizing
Lecture9 domain model visualizingShahid Riaz
Ā 
Lecture8 system sequence
Lecture8 system sequenceLecture8 system sequence
Lecture8 system sequenceShahid Riaz
Ā 
Lecture7 use case modeling
Lecture7 use case modelingLecture7 use case modeling
Lecture7 use case modelingShahid Riaz
Ā 
Lecture6 activity diagrams
Lecture6 activity diagramsLecture6 activity diagrams
Lecture6 activity diagramsShahid Riaz
Ā 
Lecture 5 defining the system
Lecture 5 defining the systemLecture 5 defining the system
Lecture 5 defining the systemShahid Riaz
Ā 

More from Shahid Riaz (20)

Shimla deputation (1906)
Shimla deputation (1906)Shimla deputation (1906)
Shimla deputation (1906)
Ā 
#Syed ahmad shaheed barailvi
#Syed ahmad shaheed barailvi#Syed ahmad shaheed barailvi
#Syed ahmad shaheed barailvi
Ā 
How to program in c++ with 100 examples
How to program in c++ with 100 examples  How to program in c++ with 100 examples
How to program in c++ with 100 examples
Ā 
Virtual private networks in theory and practice
Virtual private networks in theory and practiceVirtual private networks in theory and practice
Virtual private networks in theory and practice
Ā 
Database systems administration week 1
Database systems administration week 1Database systems administration week 1
Database systems administration week 1
Ā 
Database systems administration traning 02
Database systems administration traning 02Database systems administration traning 02
Database systems administration traning 02
Ā 
Database systems administration traning 02
Database systems administration traning 02Database systems administration traning 02
Database systems administration traning 02
Ā 
Database systems administration traning 01
Database systems administration traning 01Database systems administration traning 01
Database systems administration traning 01
Ā 
Database systems administration traning 0
Database systems administration traning 0Database systems administration traning 0
Database systems administration traning 0
Ā 
Database systems administration traning 04
Database systems administration traning  04Database systems administration traning  04
Database systems administration traning 04
Ā 
Managing people and organizing team
Managing people and organizing teamManaging people and organizing team
Managing people and organizing team
Ā 
Lec 1 intro to internet
Lec 1 intro to internetLec 1 intro to internet
Lec 1 intro to internet
Ā 
Course guidlines course book it 3548
Course guidlines course book it 3548Course guidlines course book it 3548
Course guidlines course book it 3548
Ā 
Lecture11 use case sequence diagram
Lecture11 use case sequence diagramLecture11 use case sequence diagram
Lecture11 use case sequence diagram
Ā 
Lecture10 use case model operation contracts
Lecture10 use case model operation contractsLecture10 use case model operation contracts
Lecture10 use case model operation contracts
Ā 
Lecture9 domain model visualizing
Lecture9 domain model visualizingLecture9 domain model visualizing
Lecture9 domain model visualizing
Ā 
Lecture8 system sequence
Lecture8 system sequenceLecture8 system sequence
Lecture8 system sequence
Ā 
Lecture7 use case modeling
Lecture7 use case modelingLecture7 use case modeling
Lecture7 use case modeling
Ā 
Lecture6 activity diagrams
Lecture6 activity diagramsLecture6 activity diagrams
Lecture6 activity diagrams
Ā 
Lecture 5 defining the system
Lecture 5 defining the systemLecture 5 defining the system
Lecture 5 defining the system
Ā 

Recently uploaded

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
Ā 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
Ā 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
Ā 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
Ā 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
Ā 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
Ā 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
Ā 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
Ā 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
Ā 
(Genuine) Escort Service Lucknow | Starting ā‚¹,5K To @25k with A/C šŸ§‘šŸ½ā€ā¤ļøā€šŸ§‘šŸ» 89...
(Genuine) Escort Service Lucknow | Starting ā‚¹,5K To @25k with A/C šŸ§‘šŸ½ā€ā¤ļøā€šŸ§‘šŸ» 89...(Genuine) Escort Service Lucknow | Starting ā‚¹,5K To @25k with A/C šŸ§‘šŸ½ā€ā¤ļøā€šŸ§‘šŸ» 89...
(Genuine) Escort Service Lucknow | Starting ā‚¹,5K To @25k with A/C šŸ§‘šŸ½ā€ā¤ļøā€šŸ§‘šŸ» 89...gurkirankumar98700
Ā 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
Ā 
Call Girls in Naraina Delhi šŸ’ÆCall Us šŸ”8264348440šŸ”
Call Girls in Naraina Delhi šŸ’ÆCall Us šŸ”8264348440šŸ”Call Girls in Naraina Delhi šŸ’ÆCall Us šŸ”8264348440šŸ”
Call Girls in Naraina Delhi šŸ’ÆCall Us šŸ”8264348440šŸ”soniya singh
Ā 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
Ā 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
Ā 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
Ā 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto GonzƔlez Trastoy
Ā 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
Ā 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
Ā 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
Ā 

Recently uploaded (20)

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Ā 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
Ā 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
Ā 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Ā 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
Ā 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
Ā 
Call Girls In Mukherjee Nagar šŸ“± 9999965857 šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...
Call Girls In Mukherjee Nagar šŸ“±  9999965857  šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...Call Girls In Mukherjee Nagar šŸ“±  9999965857  šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...
Call Girls In Mukherjee Nagar šŸ“± 9999965857 šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...
Ā 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Ā 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Ā 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Ā 
(Genuine) Escort Service Lucknow | Starting ā‚¹,5K To @25k with A/C šŸ§‘šŸ½ā€ā¤ļøā€šŸ§‘šŸ» 89...
(Genuine) Escort Service Lucknow | Starting ā‚¹,5K To @25k with A/C šŸ§‘šŸ½ā€ā¤ļøā€šŸ§‘šŸ» 89...(Genuine) Escort Service Lucknow | Starting ā‚¹,5K To @25k with A/C šŸ§‘šŸ½ā€ā¤ļøā€šŸ§‘šŸ» 89...
(Genuine) Escort Service Lucknow | Starting ā‚¹,5K To @25k with A/C šŸ§‘šŸ½ā€ā¤ļøā€šŸ§‘šŸ» 89...
Ā 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
Ā 
Call Girls in Naraina Delhi šŸ’ÆCall Us šŸ”8264348440šŸ”
Call Girls in Naraina Delhi šŸ’ÆCall Us šŸ”8264348440šŸ”Call Girls in Naraina Delhi šŸ’ÆCall Us šŸ”8264348440šŸ”
Call Girls in Naraina Delhi šŸ’ÆCall Us šŸ”8264348440šŸ”
Ā 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
Ā 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
Ā 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
Ā 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Ā 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Ā 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
Ā 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Ā 

Lecture12 software design class diagram

  • 1. Software Design Class Diagram Material based on [Booch99, Rambaugh99, Jacobson99, Fowler97, Brown99]
  • 2. Classes ClassName attributes operations A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics. Graphically, a class is rendered as a rectangle, usually including its name, attributes, and operations in separate, designated compartments.
  • 3. Class Names ClassName attributes operations 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.
  • 4. Class Attributes Person name : String address : Address birthdate : Date ssn : Id 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.
  • 5. Class Attributes (Contā€™d) Person name : String address : Address birthdate : Date / age : Date ssn : Id Attributes are usually listed in the form: attributeName : Type A derived attribute is one that can be computed from other attributes, but doesnā€™t actually exist. For example, a Personā€™s age can be computed from his birth date. A derived attribute is designated by a preceding ā€˜/ā€™ as in: / age : Date
  • 6. Class Attributes (Contā€™d) Person + name : String # address : Address # birthdate : Date / age : Date - ssn : Id Attributes can be: + public # protected - private / derived
  • 7. Class Operations Person name : String address : Address birthdate : Date ssn : Id eat sleep work play Operations describe the class behavior and appear in the third compartment.
  • 8. Class Operations (Contā€™d) PhoneBook newEntry (n : Name, a : Address, p : PhoneNumber, d : Description) getPhone ( n : Name, a : Address) : PhoneNumber You can specify an operation by stating its signature: listing the name, type, and default value of all parameters, and, in the case of functions, a return type.
  • 9. Depicting Classes Person name : String birthdate : Date ssn : Id eat() sleep() work() play() When drawing a class, you neednā€™t show attributes and operation in every diagram. Person Person name address birthdate Person eat play Person
  • 10. Class Responsibilities A class may also include its responsibilities in a class diagram. A responsibility is a contract or obligation of a class to perform a particular service. SmokeAlarm Responsibilities -- sound alert and notify guard station when smoke is detected. -- indicate battery state
  • 11. Relationships In UML, object interconnections (logical or physical), are modeled as relationships. There are three kinds of relationships in UML: ā€¢ dependencies ā€¢ generalizations ā€¢ associations
  • 12. Dependency Relationships CourseSchedule add(c : Course) remove(c : Course) Course A dependency indicates a semantic relationship between two or more elements. The dependency from CourseSchedule to Course exists because Course is used in both the add and remove operations of CourseSchedule.
  • 13. Generalization Relationships Person A generalization connects a subclass to its superclass. It denotes an inheritance of attributes and behavior from the superclass to the subclass and indicates a specialization in the subclass of the more general superclass. Student
  • 14. Generalization Relationships (Contā€™d) Student UML permits a class to inherit from multiple superclasses, although some programming languages (e.g., Java) do not permit multiple inheritance. TeachingAssistant Employee
  • 15. Association Relationships If two classes in a model need to communicate with each other, there must be link between them. An association denotes that link. InstructorStudent
  • 16. Association Relationships (Contā€™d) We can indicate the multiplicity of an association by adding multiplicity adornments to the line denoting the association. The example indicates that a Student has one or more Instructors: InstructorStudent 1..*
  • 17. Association Relationships (Contā€™d) The example indicates that every Instructor has one or more Students: InstructorStudent 1..*
  • 18. Association Relationships (Contā€™d) We can also indicate the behavior of an object in an association (i.e., the role of an object) using rolenames. InstructorStudent 1..*1..* learns fromteaches
  • 19. Association Relationships (Contā€™d) We can also name the association. TeamStudent membership 1..* 1..*
  • 20. Association Relationships (Contā€™d) We can specify dual associations. TeamStudent member of 1..* president of1 1..* 1..*
  • 21. Association Relationships (Contā€™d) We can constrain the association relationship by defining the navigability of the association. Here, a Router object requests services from a DNS object by sending messages to (invoking the operations of) the server. The direction of the association indicates that the server has no knowledge of the Router. Router DomainNameServer
  • 22. Association Relationships (Contā€™d) Associations can also be objects themselves, called link classes or an association classes. WarrantyProduct Registration modelNumber serialNumber warrentyCode
  • 23. Association Relationships (Contā€™d) A class can have a self association. LinkedListNode next previous
  • 24. Association Relationships (Contā€™d) We can model objects that contain other objects by way of special associations called aggregations and compositions. An aggregation specifies a whole-part relationship between an aggregate (a whole) and a constituent part, where the part can exist independently from the aggregate. Aggregations are denoted by a hollow-diamond adornment on the association. Car Engine Transmission
  • 25. Association Relationships (Contā€™d) A composition indicates a strong ownership and coincident lifetime of parts by the whole (i.e., they live and die as a whole). Compositions are denoted by a filled-diamond adornment on the association. Window Scrollbar Titlebar Menu 1 1 1 1 1 1 .. *
  • 26. Interfaces An interface is a named set of operations that specifies the behavior of objects without showing their inner structure. It can be rendered in the model by a one- or two-compartment rectangle, with the stereotype <<interface>> above the interface name. <<interface>> ControlPanel
  • 27. Interface Services Interfaces do not get instantiated. They have no attributes or state. Rather, they specify the services offered by a related class. <<interface>> ControlPanel getChoices : Choice[] makeChoice (c : Choice) getSelection : Selection
  • 28. Exceptions <<exception>> KeyException <<exception>> SQLException <<exception>> Exception getMessage() printStackTrace() Exceptions can be modeled just like any other class. Notice the <<exception>> stereotype in the name compartment.
  • 29. Packages Compiler A package is a container-like element for organizing other elements into groups. A package can contain classes and other packages and diagrams. Packages can be used to provide controlled access between classes in different packages.
  • 30. Example: Problem Report Tool ļ¬A CASE tool for storing and tracking problem reports ļ‚”Each report contains a problem description and a status ļ‚”Each problem can be assigned to someone ļ‚”Problem reports are made on one of the ā€œartifactsā€ of a project ļ‚”Employees are assigned to a project ļ‚”A manager may add new artifacts and assign problem reports to team members
  • 31. Class Diagram for Prob. Rep. Tool Employee +name:string Manager Developer Project +name:string Artifact +name:string +status:enum ProblemReport HistoryEntry -when:Date -whatDone:string CodeBugReport 1 0..n ResponsibleFor 0..* 1 1 0..n About 0..n 1 HistoryLog 1..* 0..* AssignedTo 1 0..* ManagedBy