SlideShare a Scribd company logo
1 of 30
Class-based Modeling
Outline
• What is a class diagram?
• Identifying classes
• Elements of a UML Class Diagram
– Associations
– Generalization
– Dependencies
3
Essential Elements of a UML
Class Diagram
• Class
• Attributes
• Operations
• Relationships
– Associations
– Generalization
– Dependency
– Realization
• Constraint Rules and Notes
4
What is a Class Diagram?
• A class diagram describes the types of
objects in the system and the various kinds of
static relationships that exist among them.
– A graphical representation of a static view on
declarative static elements.
• A central modeling technique that runs
through nearly all object-oriented methods.
• The richest notation in UML.
5
Classes
• A class is the description of a set of
objects having similar attributes,
operations, relationships and behavior.
Window
size: Size
visibility: boolean
display()
hide()
Class
Name
Attributes
Operations
Identifying Analysis Classes
1) Perform a grammatical parse of the problem statement or use cases
2) Classes are determined by underlining each noun or noun clause
3) A class required to implement a solution is part of the solution space
4) A class necessary only to describe a solution is part of the problem space
5) A class should NOT have an imperative procedural name (i.e., a verb)
6) List the potential class names in a table and "classify" each class according
to some taxonomy and class selection characteristics
7) A potential class should satisfy nearly all (or all) of the selection
characteristics to be considered a legitimate problem domain class
(More on next slide)
Potential classes General
classification
Selection
Characteristic
s
Grammatical Parse
• The SafeHome security function enables the homeowner to configure the security
system when it is installed, monitors all sensors connected to the security system, and
interacts with the homeowner through the Internet, a PC, or a control panel.
• During installation, the SafeHome PC is used to program and configure the system. Each
sensor is assigned a number and type, a master password is programmed for arming and
disarming the system, and telephone number(s) are input for dialing when a sensor event
occurs.
• When a sensor event is recognized, the software invokes an audible alarm attached to
the system. After a delay time that is specified by the homeowner during system
configuration activities, the software dials a telephone number of a monitoring service,
provides information about the location, reporting the nature of the event that has been
detected. The telephone number will be redialed every 20 seconds until a telephone
connection is obtained.
• The homeowner receives security information via a control panel, the PC, or a browser,
collectively called an interface. The interface displays prompting messages and system
status information on the control panel, the PC, or the browser window. Homeowner
interaction takes the following form…
Grammatical Parse
• The SafeHome security function enables the homeowner to configure the security
system when it is installed, monitors all sensors connected to the security system, and
interacts with the homeowner through the Internet, a PC, or a control panel.
• During installation, the SafeHome PC is used to program and configure the system.
Each sensor is assigned a number and type, a master password is programmed for
arming and disarming the system, and telephone number(s) are input for dialing when
a sensor event occurs.
• When a sensor event is recognized, the software invokes an audible alarm attached to
the system. After a delay time that is specified by the homeowner during system
configuration activities, the software dials a telephone number of a monitoring service,
provides information about the location, reporting the nature of the event that has been
detected. The telephone number will be redialed every 20 seconds until a telephone
connection is obtained.
• The homeowner receives security information via a control panel, the PC, or a
browser, collectively called an interface. The interface displays prompting messages
and system status information on the control panel, the PC, or the browser window.
Homeowner interaction takes the following form…
• General classifications for a potential class
– External entity (e.g., another system, a device, a person)
– Thing (e.g., report, screen display)
– Occurrence or event (e.g., movement, completion)
– Role (e.g., manager, engineer, salesperson)
– Organizational unit (e.g., division, group, team)
– Place (e.g., manufacturing floor, loading dock)
– Structure (e.g., sensor, vehicle, computer)
Identifying Analysis Classes
(continued)
(More on next slide)
Class Selection Criteria
1. Retained information
2. Needed services
3. Multiple attributes
4. Common attributes
5. Common operations
6. Essential requirements
Identifying Classes
Potential class Classification Accept / Reject
homeowner role; external entity reject: 1, 2 fail
sensor external entity accept
control panel external entity accept
installation occurrence reject
(security) system thing accept
number, type not objects, attributes reject: 3 fails
master password thing reject: 3 fails
telephone number thing reject: 3 fails
sensor event occurrence accept
audible alarm external entity accept: 1 fails
monitoring service organizational unit; ee reject: 1, 2 fail
Defining Attributes of a Class
• Attributes of a class are those nouns from the grammatical parse
that reasonably belong to a class
• Attributes hold the values that describe the current properties or
state of a class
• An attribute may also appear initially as a potential class that is later
rejected because of the class selection criteria
• In identifying attributes, the following question should be answered
– What data items (composite and/or elementary) will fully define a
specific class in the context of the problem at hand?
• Usually an item is not an attribute if more than one of them is to be
associated with a class
Defining Operations of a Class
• Operations define the behavior of an object
• Four categories of operations
– Operations that manipulate data in some way to change the state of an
object (e.g., add, delete, modify)
– Operations that perform a computation
– Operations that inquire about the state of an object
– Operations that monitor an object for the occurrence of a controlling
event
• An operation has knowledge about the state of a class and the
nature of its associations
• The action performed by an operation is based on the current
values of the attributes of a class
• Using a grammatical parse again, circle the verbs; then select the
verbs that relate to the problem domain classes that were
previously identified
Identifying operations
• The SafeHome security function enables the homeowner to configure the security
system when it is installed, monitors all sensors connected to the security system, and
interacts with the homeowner through the Internet, a PC, or a control panel.
• During installation, the SafeHome PC is used to program and configure the system. Each
sensor is assigned a number and type, a master password is programmed for arming and
disarming the system, and telephone number(s) are input for dialing when a sensor event
occurs.
• When a sensor event is recognized, the software invokes an audible alarm attached to
the system. After a delay time that is specified by the homeowner during system
configuration activities, the software dials a telephone number of a monitoring service,
provides information about the location, reporting the nature of the event that has been
detected. The telephone number will be redialed every 20 seconds until a telephone
connection is obtained.
• The homeowner receives security information via a control panel, the PC, or a browser,
collectively called an interface. The interface displays prompting messages and system
status information on the control panel, the PC, or the browser window. Homeowner
interaction takes the following form…
Identifying operations
• The SafeHome security function enables the homeowner to configure the security
system when it is installed, monitors all sensors connected to the security system, and
interacts with the homeowner through the Internet, a PC, or a control panel.
• During installation, the SafeHome PC is used to program and configure the system. Each
sensor is assigned a number and type, a master password is programmed for arming and
disarming the system, and telephone number(s) are input for dialing when a sensor event
occurs.
• When a sensor event is recognized, the software invokes an audible alarm attached to
the system. After a delay time that is specified by the homeowner during system
configuration activities, the software dials a telephone number of a monitoring service,
provides information about the location, reporting the nature of the event that has been
detected. The telephone number will be redialed every 20 seconds until a telephone
connection is obtained.
• The homeowner receives security information via a control panel, the PC, or a browser,
collectively called an interface. The interface displays prompting messages and system
status information on the control panel, the PC, or the browser window. Homeowner
interaction takes the following form…
Class Diagram
Class diagram for the system class
Class Diagram
Class diagram for FloorPlan
Class Diagrams
Top: Multiplicity
Bottom: Dependencies
19
Associations
• A semantic relationship between two or more classes
that specifies connections among their instances.
• A structural relationship, specifying that objects of
one class are connected to objects of a second
(possibly the same) class.
• Example: “An Employee works for a Company”
Company
Department
Employee
20
Associations (cont.)
• An association between two classes indicates
that objects at one end of an association
“recognize” objects at the other end and may
send messages to them.
– This property will help us discover less trivial
associations using interaction diagrams.
21
Associations (cont.)
StaffMember Student
1..* *
instructs
instructor
Association
name
Role
name
Multiplicity
Navigable
(uni-directional)
association
Courses
pre -
requisites
0..3
Reflexive
association
Role
*
UML Class Diagrams 22
Associations (cont.)
• To clarify its meaning, an association may be
named.
– The name is represented as a label placed midway
along the association line.
– Usually a verb or a verb phrase.
• A role is an end of an association where it
connects to a class.
– May be named to indicate the role played by the class
attached to the end of the association path.
• Usually a noun or noun phrase
• Mandatory for reflexive associations
UML Class Diagrams 23
Associations (cont.)
• Multiplicity
– The number of instances of the class, next to
which the multiplicity expression appears, that
are referenced by a single instance of the
class that is at the other end of the
association path.
– Indicates whether or not an association is
mandatory.
– Provides a lower and upper bound on the
number of instances.
UML Class Diagrams 24
Associations (cont.)
– Multiplicity Indicators
Exactly one 1
Zero or more (unlimited) * (0..*)
One or more 1..*
Zero or one (optional association) 0..1
Specified range 2..4
Multiple, disjoint ranges 2, 4..6, 8
25
Aggregation
• A special form of association that models a
whole-part relationship between an aggregate
(the whole) and its parts.
– Models a “is a part-part of” relationship.
Whole Part
Car Door House
1..*
2..*
UML Class Diagrams 26
Aggregation (cont.)
• Aggregation tests:
– Is the phrase “part of” used to describe the
relationship?
• A door is “part of” a car
– Are some operations on the whole automatically
applied to its parts?
• Move the car, move the door.
– Are some attribute values propagated from the
whole to all or some of its parts?
• The car is blue, therefore the door is blue.
– Is there an intrinsic asymmetry to the relationship
where one class is subordinate to the other?
• A door is part of a car. A car is not part of a door.
UML Class Diagrams 27
Composition
• A strong form of aggregation
– The whole is the sole owner of its part.
• The part object may belong to only one whole
– Multiplicity on the whole side must be zero or one.
– The life time of the part is dependent upon the
whole.
• The composite must manage the creation and
destruction of its parts.
Circle Point
3..*
1
Polygon
Point
Circle
28
Generalization
• Indicates that objects of the specialized class
(subclass) are substitutable for objects of the
generalized class (super-class).
– “is kind of” relationship.
Shape
{abstract}
Circle
Super
Class
Sub
Class
An abstract
class
Generalizatio
n relationship
{abstract} is a
tagged value that
indicates that the
class is abstract.
The name of an
abstract class
should be italicized
29
Generalization
• A sub-class inherits from its super-class
– Attributes
– Operations
– Relationships
• A sub-class may
– Add attributes and operations
– Add relationships
– Refine (override) inherited operations
• A generalization relationship may not be
used to model interface implementation.
Summary
• What is a class diagram?
• Identifying classes/Operations/Attributes
• Associations
– Simple associations
– Multiplicity
– Aggregation
– Composition
– Generalization

More Related Content

Similar to lecture_18class_diagrams.ppt

Embedded OS and Application-2024-01 Embedded system introduction.pdf
Embedded OS and Application-2024-01 Embedded system introduction.pdfEmbedded OS and Application-2024-01 Embedded system introduction.pdf
Embedded OS and Application-2024-01 Embedded system introduction.pdfmengsteabtewelde
 
Monitoring of computers
Monitoring of computers Monitoring of computers
Monitoring of computers carlosrudy_45
 
Domino Effect and Analysis | Relaibility Analysis | Unavailability Analysis
Domino Effect and Analysis | Relaibility Analysis | Unavailability AnalysisDomino Effect and Analysis | Relaibility Analysis | Unavailability Analysis
Domino Effect and Analysis | Relaibility Analysis | Unavailability AnalysisGaurav Singh Rajput
 
Domino Effect and Analysis | Gaurav Singh Rajput
Domino Effect and Analysis | Gaurav Singh RajputDomino Effect and Analysis | Gaurav Singh Rajput
Domino Effect and Analysis | Gaurav Singh RajputGaurav Singh Rajput
 
L11 Transition And Key Roles and SAT ROB IRP.pptx
L11 Transition And Key Roles and SAT ROB IRP.pptxL11 Transition And Key Roles and SAT ROB IRP.pptx
L11 Transition And Key Roles and SAT ROB IRP.pptxStevenTharp2
 
Data representation and visualization ppt
Data representation and visualization pptData representation and visualization ppt
Data representation and visualization pptSindhujaCSEngineerin
 
Embedded Basics
Embedded Basics Embedded Basics
Embedded Basics Electro 8
 
Enterprise Integration
Enterprise IntegrationEnterprise Integration
Enterprise IntegrationSyAM Software
 
EMKA-Biometric Presentation
EMKA-Biometric PresentationEMKA-Biometric Presentation
EMKA-Biometric PresentationDarrell Smith
 
A Study Of Real-Time Embedded Software Systems And Real-Time Operating Systems
A Study Of Real-Time Embedded Software Systems And Real-Time Operating SystemsA Study Of Real-Time Embedded Software Systems And Real-Time Operating Systems
A Study Of Real-Time Embedded Software Systems And Real-Time Operating SystemsRick Vogel
 
Embedded system notes
Embedded system notesEmbedded system notes
Embedded system notesTARUN KUMAR
 
ANET SureLog SIEM IntelligentResponse
ANET SureLog  SIEM IntelligentResponseANET SureLog  SIEM IntelligentResponse
ANET SureLog SIEM IntelligentResponseErtugrul Akbas
 
Architecture 4 Wireless Sensor Networks
Architecture 4 Wireless Sensor NetworksArchitecture 4 Wireless Sensor Networks
Architecture 4 Wireless Sensor NetworksIvano Malavolta
 
Security (IM).ppt
Security (IM).pptSecurity (IM).ppt
Security (IM).pptGooglePay16
 
Quality Attributes Of a Software.pptx
Quality Attributes Of a Software.pptxQuality Attributes Of a Software.pptx
Quality Attributes Of a Software.pptxjordan724752
 

Similar to lecture_18class_diagrams.ppt (20)

Embedded OS and Application-2024-01 Embedded system introduction.pdf
Embedded OS and Application-2024-01 Embedded system introduction.pdfEmbedded OS and Application-2024-01 Embedded system introduction.pdf
Embedded OS and Application-2024-01 Embedded system introduction.pdf
 
ccnc_contextPro
ccnc_contextProccnc_contextPro
ccnc_contextPro
 
Monitoring of computers
Monitoring of computers Monitoring of computers
Monitoring of computers
 
Domino Effect and Analysis | Relaibility Analysis | Unavailability Analysis
Domino Effect and Analysis | Relaibility Analysis | Unavailability AnalysisDomino Effect and Analysis | Relaibility Analysis | Unavailability Analysis
Domino Effect and Analysis | Relaibility Analysis | Unavailability Analysis
 
Domino Effect and Analysis | Gaurav Singh Rajput
Domino Effect and Analysis | Gaurav Singh RajputDomino Effect and Analysis | Gaurav Singh Rajput
Domino Effect and Analysis | Gaurav Singh Rajput
 
Socio technical system
Socio technical systemSocio technical system
Socio technical system
 
OwnYIT CSAT + SIEM
OwnYIT CSAT + SIEMOwnYIT CSAT + SIEM
OwnYIT CSAT + SIEM
 
L11 Transition And Key Roles and SAT ROB IRP.pptx
L11 Transition And Key Roles and SAT ROB IRP.pptxL11 Transition And Key Roles and SAT ROB IRP.pptx
L11 Transition And Key Roles and SAT ROB IRP.pptx
 
Data representation and visualization ppt
Data representation and visualization pptData representation and visualization ppt
Data representation and visualization ppt
 
Embedded Basics
Embedded Basics Embedded Basics
Embedded Basics
 
Enterprise Integration
Enterprise IntegrationEnterprise Integration
Enterprise Integration
 
EMKA-Biometric Presentation
EMKA-Biometric PresentationEMKA-Biometric Presentation
EMKA-Biometric Presentation
 
A Study Of Real-Time Embedded Software Systems And Real-Time Operating Systems
A Study Of Real-Time Embedded Software Systems And Real-Time Operating SystemsA Study Of Real-Time Embedded Software Systems And Real-Time Operating Systems
A Study Of Real-Time Embedded Software Systems And Real-Time Operating Systems
 
Embedded system notes
Embedded system notesEmbedded system notes
Embedded system notes
 
ANET SureLog SIEM IntelligentResponse
ANET SureLog  SIEM IntelligentResponseANET SureLog  SIEM IntelligentResponse
ANET SureLog SIEM IntelligentResponse
 
Architecture 4 Wireless Sensor Networks
Architecture 4 Wireless Sensor NetworksArchitecture 4 Wireless Sensor Networks
Architecture 4 Wireless Sensor Networks
 
Andrey Bogdanov, Dmitry Khovratovich, and Christian Rechberger
Andrey Bogdanov, Dmitry Khovratovich, and Christian RechbergerAndrey Bogdanov, Dmitry Khovratovich, and Christian Rechberger
Andrey Bogdanov, Dmitry Khovratovich, and Christian Rechberger
 
Security (IM).ppt
Security (IM).pptSecurity (IM).ppt
Security (IM).ppt
 
Bridge
BridgeBridge
Bridge
 
Quality Attributes Of a Software.pptx
Quality Attributes Of a Software.pptxQuality Attributes Of a Software.pptx
Quality Attributes Of a Software.pptx
 

More from 23017156038

class5jf.pptx Block cipher in information security
class5jf.pptx Block cipher in information securityclass5jf.pptx Block cipher in information security
class5jf.pptx Block cipher in information security23017156038
 
Network security in computer network for BS
Network security in computer network for BSNetwork security in computer network for BS
Network security in computer network for BS23017156038
 
Ppt IT Infrastructure.ppt
Ppt IT Infrastructure.pptPpt IT Infrastructure.ppt
Ppt IT Infrastructure.ppt23017156038
 
COCOMO 1 Model ppt AR-1.pdf
COCOMO 1 Model  ppt AR-1.pdfCOCOMO 1 Model  ppt AR-1.pdf
COCOMO 1 Model ppt AR-1.pdf23017156038
 
Week_01-Intro to Software Engineering-1.ppt
Week_01-Intro to Software Engineering-1.pptWeek_01-Intro to Software Engineering-1.ppt
Week_01-Intro to Software Engineering-1.ppt23017156038
 

More from 23017156038 (6)

class5jf.pptx Block cipher in information security
class5jf.pptx Block cipher in information securityclass5jf.pptx Block cipher in information security
class5jf.pptx Block cipher in information security
 
Network security in computer network for BS
Network security in computer network for BSNetwork security in computer network for BS
Network security in computer network for BS
 
Ppt IT Infrastructure.ppt
Ppt IT Infrastructure.pptPpt IT Infrastructure.ppt
Ppt IT Infrastructure.ppt
 
COCOMO 1 Model ppt AR-1.pdf
COCOMO 1 Model  ppt AR-1.pdfCOCOMO 1 Model  ppt AR-1.pdf
COCOMO 1 Model ppt AR-1.pdf
 
Datacenters.pdf
Datacenters.pdfDatacenters.pdf
Datacenters.pdf
 
Week_01-Intro to Software Engineering-1.ppt
Week_01-Intro to Software Engineering-1.pptWeek_01-Intro to Software Engineering-1.ppt
Week_01-Intro to Software Engineering-1.ppt
 

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

lecture_18class_diagrams.ppt

  • 2. Outline • What is a class diagram? • Identifying classes • Elements of a UML Class Diagram – Associations – Generalization – Dependencies
  • 3. 3 Essential Elements of a UML Class Diagram • Class • Attributes • Operations • Relationships – Associations – Generalization – Dependency – Realization • Constraint Rules and Notes
  • 4. 4 What is a Class Diagram? • A class diagram describes the types of objects in the system and the various kinds of static relationships that exist among them. – A graphical representation of a static view on declarative static elements. • A central modeling technique that runs through nearly all object-oriented methods. • The richest notation in UML.
  • 5. 5 Classes • A class is the description of a set of objects having similar attributes, operations, relationships and behavior. Window size: Size visibility: boolean display() hide() Class Name Attributes Operations
  • 6. Identifying Analysis Classes 1) Perform a grammatical parse of the problem statement or use cases 2) Classes are determined by underlining each noun or noun clause 3) A class required to implement a solution is part of the solution space 4) A class necessary only to describe a solution is part of the problem space 5) A class should NOT have an imperative procedural name (i.e., a verb) 6) List the potential class names in a table and "classify" each class according to some taxonomy and class selection characteristics 7) A potential class should satisfy nearly all (or all) of the selection characteristics to be considered a legitimate problem domain class (More on next slide) Potential classes General classification Selection Characteristic s
  • 7. Grammatical Parse • The SafeHome security function enables the homeowner to configure the security system when it is installed, monitors all sensors connected to the security system, and interacts with the homeowner through the Internet, a PC, or a control panel. • During installation, the SafeHome PC is used to program and configure the system. Each sensor is assigned a number and type, a master password is programmed for arming and disarming the system, and telephone number(s) are input for dialing when a sensor event occurs. • When a sensor event is recognized, the software invokes an audible alarm attached to the system. After a delay time that is specified by the homeowner during system configuration activities, the software dials a telephone number of a monitoring service, provides information about the location, reporting the nature of the event that has been detected. The telephone number will be redialed every 20 seconds until a telephone connection is obtained. • The homeowner receives security information via a control panel, the PC, or a browser, collectively called an interface. The interface displays prompting messages and system status information on the control panel, the PC, or the browser window. Homeowner interaction takes the following form…
  • 8. Grammatical Parse • The SafeHome security function enables the homeowner to configure the security system when it is installed, monitors all sensors connected to the security system, and interacts with the homeowner through the Internet, a PC, or a control panel. • During installation, the SafeHome PC is used to program and configure the system. Each sensor is assigned a number and type, a master password is programmed for arming and disarming the system, and telephone number(s) are input for dialing when a sensor event occurs. • When a sensor event is recognized, the software invokes an audible alarm attached to the system. After a delay time that is specified by the homeowner during system configuration activities, the software dials a telephone number of a monitoring service, provides information about the location, reporting the nature of the event that has been detected. The telephone number will be redialed every 20 seconds until a telephone connection is obtained. • The homeowner receives security information via a control panel, the PC, or a browser, collectively called an interface. The interface displays prompting messages and system status information on the control panel, the PC, or the browser window. Homeowner interaction takes the following form…
  • 9. • General classifications for a potential class – External entity (e.g., another system, a device, a person) – Thing (e.g., report, screen display) – Occurrence or event (e.g., movement, completion) – Role (e.g., manager, engineer, salesperson) – Organizational unit (e.g., division, group, team) – Place (e.g., manufacturing floor, loading dock) – Structure (e.g., sensor, vehicle, computer) Identifying Analysis Classes (continued) (More on next slide)
  • 10. Class Selection Criteria 1. Retained information 2. Needed services 3. Multiple attributes 4. Common attributes 5. Common operations 6. Essential requirements
  • 11. Identifying Classes Potential class Classification Accept / Reject homeowner role; external entity reject: 1, 2 fail sensor external entity accept control panel external entity accept installation occurrence reject (security) system thing accept number, type not objects, attributes reject: 3 fails master password thing reject: 3 fails telephone number thing reject: 3 fails sensor event occurrence accept audible alarm external entity accept: 1 fails monitoring service organizational unit; ee reject: 1, 2 fail
  • 12. Defining Attributes of a Class • Attributes of a class are those nouns from the grammatical parse that reasonably belong to a class • Attributes hold the values that describe the current properties or state of a class • An attribute may also appear initially as a potential class that is later rejected because of the class selection criteria • In identifying attributes, the following question should be answered – What data items (composite and/or elementary) will fully define a specific class in the context of the problem at hand? • Usually an item is not an attribute if more than one of them is to be associated with a class
  • 13. Defining Operations of a Class • Operations define the behavior of an object • Four categories of operations – Operations that manipulate data in some way to change the state of an object (e.g., add, delete, modify) – Operations that perform a computation – Operations that inquire about the state of an object – Operations that monitor an object for the occurrence of a controlling event • An operation has knowledge about the state of a class and the nature of its associations • The action performed by an operation is based on the current values of the attributes of a class • Using a grammatical parse again, circle the verbs; then select the verbs that relate to the problem domain classes that were previously identified
  • 14. Identifying operations • The SafeHome security function enables the homeowner to configure the security system when it is installed, monitors all sensors connected to the security system, and interacts with the homeowner through the Internet, a PC, or a control panel. • During installation, the SafeHome PC is used to program and configure the system. Each sensor is assigned a number and type, a master password is programmed for arming and disarming the system, and telephone number(s) are input for dialing when a sensor event occurs. • When a sensor event is recognized, the software invokes an audible alarm attached to the system. After a delay time that is specified by the homeowner during system configuration activities, the software dials a telephone number of a monitoring service, provides information about the location, reporting the nature of the event that has been detected. The telephone number will be redialed every 20 seconds until a telephone connection is obtained. • The homeowner receives security information via a control panel, the PC, or a browser, collectively called an interface. The interface displays prompting messages and system status information on the control panel, the PC, or the browser window. Homeowner interaction takes the following form…
  • 15. Identifying operations • The SafeHome security function enables the homeowner to configure the security system when it is installed, monitors all sensors connected to the security system, and interacts with the homeowner through the Internet, a PC, or a control panel. • During installation, the SafeHome PC is used to program and configure the system. Each sensor is assigned a number and type, a master password is programmed for arming and disarming the system, and telephone number(s) are input for dialing when a sensor event occurs. • When a sensor event is recognized, the software invokes an audible alarm attached to the system. After a delay time that is specified by the homeowner during system configuration activities, the software dials a telephone number of a monitoring service, provides information about the location, reporting the nature of the event that has been detected. The telephone number will be redialed every 20 seconds until a telephone connection is obtained. • The homeowner receives security information via a control panel, the PC, or a browser, collectively called an interface. The interface displays prompting messages and system status information on the control panel, the PC, or the browser window. Homeowner interaction takes the following form…
  • 16. Class Diagram Class diagram for the system class
  • 19. 19 Associations • A semantic relationship between two or more classes that specifies connections among their instances. • A structural relationship, specifying that objects of one class are connected to objects of a second (possibly the same) class. • Example: “An Employee works for a Company” Company Department Employee
  • 20. 20 Associations (cont.) • An association between two classes indicates that objects at one end of an association “recognize” objects at the other end and may send messages to them. – This property will help us discover less trivial associations using interaction diagrams.
  • 21. 21 Associations (cont.) StaffMember Student 1..* * instructs instructor Association name Role name Multiplicity Navigable (uni-directional) association Courses pre - requisites 0..3 Reflexive association Role *
  • 22. UML Class Diagrams 22 Associations (cont.) • To clarify its meaning, an association may be named. – The name is represented as a label placed midway along the association line. – Usually a verb or a verb phrase. • A role is an end of an association where it connects to a class. – May be named to indicate the role played by the class attached to the end of the association path. • Usually a noun or noun phrase • Mandatory for reflexive associations
  • 23. UML Class Diagrams 23 Associations (cont.) • Multiplicity – The number of instances of the class, next to which the multiplicity expression appears, that are referenced by a single instance of the class that is at the other end of the association path. – Indicates whether or not an association is mandatory. – Provides a lower and upper bound on the number of instances.
  • 24. UML Class Diagrams 24 Associations (cont.) – Multiplicity Indicators Exactly one 1 Zero or more (unlimited) * (0..*) One or more 1..* Zero or one (optional association) 0..1 Specified range 2..4 Multiple, disjoint ranges 2, 4..6, 8
  • 25. 25 Aggregation • A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts. – Models a “is a part-part of” relationship. Whole Part Car Door House 1..* 2..*
  • 26. UML Class Diagrams 26 Aggregation (cont.) • Aggregation tests: – Is the phrase “part of” used to describe the relationship? • A door is “part of” a car – Are some operations on the whole automatically applied to its parts? • Move the car, move the door. – Are some attribute values propagated from the whole to all or some of its parts? • The car is blue, therefore the door is blue. – Is there an intrinsic asymmetry to the relationship where one class is subordinate to the other? • A door is part of a car. A car is not part of a door.
  • 27. UML Class Diagrams 27 Composition • A strong form of aggregation – The whole is the sole owner of its part. • The part object may belong to only one whole – Multiplicity on the whole side must be zero or one. – The life time of the part is dependent upon the whole. • The composite must manage the creation and destruction of its parts. Circle Point 3..* 1 Polygon Point Circle
  • 28. 28 Generalization • Indicates that objects of the specialized class (subclass) are substitutable for objects of the generalized class (super-class). – “is kind of” relationship. Shape {abstract} Circle Super Class Sub Class An abstract class Generalizatio n relationship {abstract} is a tagged value that indicates that the class is abstract. The name of an abstract class should be italicized
  • 29. 29 Generalization • A sub-class inherits from its super-class – Attributes – Operations – Relationships • A sub-class may – Add attributes and operations – Add relationships – Refine (override) inherited operations • A generalization relationship may not be used to model interface implementation.
  • 30. Summary • What is a class diagram? • Identifying classes/Operations/Attributes • Associations – Simple associations – Multiplicity – Aggregation – Composition – Generalization