SlideShare a Scribd company logo
The Static Analysis Model
Class Diagrams
Prof. Hany H. Ammar, CSEE, WVU, and
Dept. of Computer Science, Faculty of
Computers and Information, Cairo
University
outline
• UML Development, the Requirements
Model and the Analysis model
• The Static Analysis Model – The Analysis
Process
– The Conceptual Level - Identifying the Classes
of Objects
– The Analysis Level – Identifying Class
relationships, class attributes, and class
operations
UML Development - Overview
PROGRAM
ACTORS
ANALYSIS
Specify Domain
Objects
Detailed DESIGN
IMPLEMENTATION
D
A
T
A
D
I
C
T
I
O
N
A
R
Y
Time
USE CASES
ANALYSIS
CLASS DIAGRAM(S)
IMPLEMENTATION
Activity DIAGRAMS
SEQUENCE
DIAGRAMS
OPERATION CONTRACTS
StateChart
DIAGRAMs
DEPLOYMENT DIAGRAM
SUBSYSTEM CLASS/
OR COMPONENT
DIAGRAMS
Architectural
Design
Include
Design Objects
Object
Design
SCENARIOS
REQUIREMENTS
ELICITATION
DESIGN DIAGRAMS
IMPLEMENTATION
CHOICES
DESIGN SEQUENCE DIAG.
REQUIREMENTS
Engineering
Design
The Requirements Model and the
Analysis Model
Static Analysis
Dynamic Analysis
Functional/
Nonfunctional
Requirements
Use Case Diagrams/
Sequence Diagrams
(the system level)
- Class Diagrams
- State Diagrams/
Refined Sequence
Diagrams (The object
level)
Requirements
Elicitation
Process
The Analysis
Process
Static Modeling
Class Diagrams
A Class is defined as
–Real world entity type about which information is stored
–Represents a collection of identical objects (instances)–
Described by means of attributes (data items)
–Has operations to access data maintained by objects
–Each object instance can be uniquely identified
Relationships between classes
–Associations
–Composition / Aggregation
–Generalization / Specialization
The Static Model
• Defines the static structure of the logical
model
• Represents classes, class hierarchies using
packages, classes, and their relationships,
• Evolve in three phases the conceptual
phase, the analysis phase, and the design
phase.
The conceptual Level
• At the conceptual phase, classes are defined based
on the classes found in the problem domain
descriptions (based on the objects identified in
step 6 in the Requirements Elicitation Process)
• A context class diagram is defined first, where the
system under development is represented by one
package, and other classes represent external
classes representing the actors
Context Class Diagram
Defines the Boundary of the system
<<external>>
Input Devices
System under
development
<<external>>
Output
Devices
Specify the classes of the external input/output devices and
other actors (users, other systems, etc.) and the system classes
See Vending Machine example in slides 5 slides no. 19-20
<<external>>
Other Actors
The conceptual Level
• The system package is defined by a diagram
representing the main classes and interface
classes to external classes
• Each subsystem is represented by a class
diagram defining the classes of objects
needed to realize the use cases defined in
the use case diagrams
The conceptual Level
Identify the system classes as Interface objects,
Monitors objects, controllers objects,
Monitors
<<Interface>>
Input_devices
or actors Controllers
<<Interface>>
Output_devices
or actors
Example of System packages of E-Commerce Application
3 types of classes: Boundary, entity, and control See text p.177
Boundary
Boundary
entity
entity
control
control
control
The Analysis Level
• At the analysis level, class diagrams are refined by
adding relationships between classes, attributes
and methods depicting how objects of the static
view are used to realize use cases in sequence
diagrams
• Emphasis is placed on distributing behavior,
resolving software interfaces, and identifying
generalization relationships that will maximize the
effectiveness of the object model
The Class Diagram Notation
• Identify classes, attributes of each class, and
operations of each class
• Classes, their attributes and methods are specified
based on the objects needed to realized use case
and interfaces to external entities (see slides 3,
registration system example: slides 26-43)
Detailed
Attributes,
Data types,
And operations
Are defined/
refined
During design
Identify Class relationships
Pilot
Commands
Aircraft
Control
Association
Aggregate/
Whole
Aggregated/
Part
Aggregation (hollow
diamond)/
Composition (solid diamond)
Child
Parent
Generalizatio
n
Associations Between Classes
• Associations between classes are generally
shown as solid lines connecting the
associated classes.
• A notable exceptions to the solid line rule
are the use of dashed lines to depict
dependencies as special case of association,
Associations
• Association is
–static, structural relationship between classes
–E.g, Employee works in Department
– Multiplicity of Associations
• Specifies how many instances of one class may relate to a
single association, Company hasPresident
– 1-to-many association, Bank managesAccount
– Optional association (0, 1, or many) –Customer
ownsCredit Card instance of another class
– 1-to-1
– Many-to-Many association –Course has Student, and
Student attends Course
Dependency: A Special Case of
Association
Dependency
RequestHandler ResponseHandler
TimerEvent
CommandManager
CommandManager (Client class) depends on services
provided by the other three server classes
Client
Aggregation Relation
• Aggregation – A hollow diamond is
attached to the end of the path to indicate
aggregation. The diamond is attached to the
class that is the aggregate. Aggregation
provides a definitive conceptual whole part
relationship
Aggregation Example
Explore other examples of Aggregation
Is an aggregate of
Zero or more of
Composition: A Special Case of
Aggregation
Composition is shown as a solid filled diamond, with
the diamond attached to the class that is the
composite. Composition is a form of aggregation
that requires coincident lifetime of the part with
the whole and singular ownership; i.e. the part is
owned by only one whole and is deleted when the
whole is deleted
+ sendPacket(pk: const cmd_pktCToCHeader*)
MQSendPacket
MQWrite
Is composed of
Composition example
Generalization/Specialization
Relation
• Generalization is shown as a solid-line
arrow from the child (the more specific
element) to the parent (the more general
elementthis type of relationship is also
called inheritance.
• Should be used to define class hierarchies based
on abstraction
Generalization/Specialization
Relation
• Controllers and Monitors are examples of abstract
classes
Controller
Brake Controller Engine Controller
Multiplicity of Relationships
Multiplici
ties
Meaning
0..1
zero or one instance. The notation n . . m
indicates n to m instances.
0..* or
*
no limit on the number of instances
(including none).
1 exactly one instance
1..* at least one instance
Example of identifying Class Relations, Multiplicities,
Attributes and operations
The Vending Machine
Analysis Level Class Diagram
Ve nding Machin e
C ontrolle r
Num e ric Ke ypad
W ire le ss
Ke yboard
C RT D isplay
Mon e y D e te ction
Hardware
Mone y D ispe nse r
Product
D ispe n se r
Product D atabase
The Vending Machine
Design Level Class Diagram
+Sendmoneytocustomer()
+Sendchangetocustomer()
+calculatechangeexactchange()
-attribute1
Money Dispenser
+sendproducttocustomer()
-attribute1
Product Dispenser
+ShowmessagesonScreen()
CRT Display
+ReadoperatorInput()()
+SendSignalstoVMCOntroller()
WirelessKeyBoard
+Readcustomerselction()
+SendSignaltoVMController()
NumericKeyPad
+getproductID()()
+getmoneyammount()()
+sendquieries()
+receiveresult()
+sendresponse()
DatabaseController
+receiveinputsignalfromNumericPad()
+RecieveinputsignalsfromWirelessKeyboard()
+SendshowmessgaetoCRT()
+DisableHWcomponents()
+sendCommandtoProductdispense()
+SendcommandtoMoneydispenser()
+ReceiveMoneyforMoneyDectectorhw()
-NPID
-WKB
-Moneydectorswitchoff
-Money
-Productdiableswicthoff
-Moneydispenserswitchoff
VmController
-End1
*
-End2
*
-End3 *
-End4
*
-End5 *
-End6 *
-End7 *
-End8 *
-End9
*
-End10
*
-End11 *
-End12 *
Example of Software Architecture
Using UML2
• SATELLITE CONTROL SYSTEM
Architecture
A Simple Example of Software
Architecture Using UML2
• SATELLITE CONTROL SYSTEM
Architecture

More Related Content

PPT
umlpresentation-140519151641-phpapp02.ppt
PPT
umlpresentation-140519151641-phpapp02.ppt
PPT
CASE Tools lab.ppt
PPT
CASE Tools lab.ppt
PPTX
UML Design Document Training Learn UML .pptx
PPTX
UML Design Document Training Learn UML .pptx
PPTX
SMD Unit ii
PPTX
SMD Unit ii
umlpresentation-140519151641-phpapp02.ppt
umlpresentation-140519151641-phpapp02.ppt
CASE Tools lab.ppt
CASE Tools lab.ppt
UML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptx
SMD Unit ii
SMD Unit ii

Similar to class diagrams and their relationships (20)

PPTX
Interaction modelling is further classified into two types: Use case diagram....
PPTX
Interaction modelling is further classified into two types: Use case diagram....
PPT
UML Introduction The system development life cycle (SDLC) is a complex projec...
PPT
UML Introduction The system development life cycle (SDLC) is a complex projec...
PPTX
UNIT II STATIC UML DIAGRAMS.pptx
PPTX
UNIT II STATIC UML DIAGRAMS.pptx
PPT
Uml package diagram
PPT
Uml package diagram
PPTX
05 fse requirementsengineering
PPTX
05 fse requirementsengineering
PPT
uml.ppt
PPT
uml.ppt
PPT
Lecture#03, uml diagrams
PPT
Lecture#03, uml diagrams
PPTX
Cs 1023 lec 10 uml (week 3)
PPTX
Cs 1023 lec 10 uml (week 3)
PPT
UML Diagrams
PPT
UML Diagrams
PPT
Analysis modeling
PPT
Analysis modeling
Interaction modelling is further classified into two types: Use case diagram....
Interaction modelling is further classified into two types: Use case diagram....
UML Introduction The system development life cycle (SDLC) is a complex projec...
UML Introduction The system development life cycle (SDLC) is a complex projec...
UNIT II STATIC UML DIAGRAMS.pptx
UNIT II STATIC UML DIAGRAMS.pptx
Uml package diagram
Uml package diagram
05 fse requirementsengineering
05 fse requirementsengineering
uml.ppt
uml.ppt
Lecture#03, uml diagrams
Lecture#03, uml diagrams
Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)
UML Diagrams
UML Diagrams
Analysis modeling
Analysis modeling
Ad

More from reshmy12 (6)

PPTX
Js tutorial(Basic concepts, running a program ,console,variable,types etc..)
PPTX
SUBMERGED FLOATING TUNNEL,COMPETITIVE FEATURES OF SFT CASE STUDY ON A SFT : T...
PPTX
Functions in c
PPTX
Encryption.ppt
PPTX
Css with example
PPTX
INTRUDUCTION TO HTML 5
Js tutorial(Basic concepts, running a program ,console,variable,types etc..)
SUBMERGED FLOATING TUNNEL,COMPETITIVE FEATURES OF SFT CASE STUDY ON A SFT : T...
Functions in c
Encryption.ppt
Css with example
INTRUDUCTION TO HTML 5
Ad

Recently uploaded (20)

PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
additive manufacturing of ss316l using mig welding
PDF
737-MAX_SRG.pdf student reference guides
PDF
composite construction of structures.pdf
PPT
Mechanical Engineering MATERIALS Selection
PDF
PPT on Performance Review to get promotions
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Artificial Intelligence
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Current and future trends in Computer Vision.pptx
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Foundation to blockchain - A guide to Blockchain Tech
R24 SURVEYING LAB MANUAL for civil enggi
additive manufacturing of ss316l using mig welding
737-MAX_SRG.pdf student reference guides
composite construction of structures.pdf
Mechanical Engineering MATERIALS Selection
PPT on Performance Review to get promotions
III.4.1.2_The_Space_Environment.p pdffdf
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Artificial Intelligence
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Current and future trends in Computer Vision.pptx
Fundamentals of safety and accident prevention -final (1).pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CH1 Production IntroductoryConcepts.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...

class diagrams and their relationships

  • 1. The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University
  • 2. outline • UML Development, the Requirements Model and the Analysis model • The Static Analysis Model – The Analysis Process – The Conceptual Level - Identifying the Classes of Objects – The Analysis Level – Identifying Class relationships, class attributes, and class operations
  • 3. UML Development - Overview PROGRAM ACTORS ANALYSIS Specify Domain Objects Detailed DESIGN IMPLEMENTATION D A T A D I C T I O N A R Y Time USE CASES ANALYSIS CLASS DIAGRAM(S) IMPLEMENTATION Activity DIAGRAMS SEQUENCE DIAGRAMS OPERATION CONTRACTS StateChart DIAGRAMs DEPLOYMENT DIAGRAM SUBSYSTEM CLASS/ OR COMPONENT DIAGRAMS Architectural Design Include Design Objects Object Design SCENARIOS REQUIREMENTS ELICITATION DESIGN DIAGRAMS IMPLEMENTATION CHOICES DESIGN SEQUENCE DIAG. REQUIREMENTS Engineering Design
  • 4. The Requirements Model and the Analysis Model Static Analysis Dynamic Analysis Functional/ Nonfunctional Requirements Use Case Diagrams/ Sequence Diagrams (the system level) - Class Diagrams - State Diagrams/ Refined Sequence Diagrams (The object level) Requirements Elicitation Process The Analysis Process
  • 5. Static Modeling Class Diagrams A Class is defined as –Real world entity type about which information is stored –Represents a collection of identical objects (instances)– Described by means of attributes (data items) –Has operations to access data maintained by objects –Each object instance can be uniquely identified Relationships between classes –Associations –Composition / Aggregation –Generalization / Specialization
  • 6. The Static Model • Defines the static structure of the logical model • Represents classes, class hierarchies using packages, classes, and their relationships, • Evolve in three phases the conceptual phase, the analysis phase, and the design phase.
  • 7. The conceptual Level • At the conceptual phase, classes are defined based on the classes found in the problem domain descriptions (based on the objects identified in step 6 in the Requirements Elicitation Process) • A context class diagram is defined first, where the system under development is represented by one package, and other classes represent external classes representing the actors
  • 8. Context Class Diagram Defines the Boundary of the system <<external>> Input Devices System under development <<external>> Output Devices Specify the classes of the external input/output devices and other actors (users, other systems, etc.) and the system classes See Vending Machine example in slides 5 slides no. 19-20 <<external>> Other Actors
  • 9. The conceptual Level • The system package is defined by a diagram representing the main classes and interface classes to external classes • Each subsystem is represented by a class diagram defining the classes of objects needed to realize the use cases defined in the use case diagrams
  • 10. The conceptual Level Identify the system classes as Interface objects, Monitors objects, controllers objects, Monitors <<Interface>> Input_devices or actors Controllers <<Interface>> Output_devices or actors
  • 11. Example of System packages of E-Commerce Application 3 types of classes: Boundary, entity, and control See text p.177 Boundary Boundary entity entity control control control
  • 12. The Analysis Level • At the analysis level, class diagrams are refined by adding relationships between classes, attributes and methods depicting how objects of the static view are used to realize use cases in sequence diagrams • Emphasis is placed on distributing behavior, resolving software interfaces, and identifying generalization relationships that will maximize the effectiveness of the object model
  • 13. The Class Diagram Notation • Identify classes, attributes of each class, and operations of each class • Classes, their attributes and methods are specified based on the objects needed to realized use case and interfaces to external entities (see slides 3, registration system example: slides 26-43) Detailed Attributes, Data types, And operations Are defined/ refined During design
  • 15. Associations Between Classes • Associations between classes are generally shown as solid lines connecting the associated classes. • A notable exceptions to the solid line rule are the use of dashed lines to depict dependencies as special case of association,
  • 16. Associations • Association is –static, structural relationship between classes –E.g, Employee works in Department – Multiplicity of Associations • Specifies how many instances of one class may relate to a single association, Company hasPresident – 1-to-many association, Bank managesAccount – Optional association (0, 1, or many) –Customer ownsCredit Card instance of another class – 1-to-1 – Many-to-Many association –Course has Student, and Student attends Course
  • 17. Dependency: A Special Case of Association Dependency RequestHandler ResponseHandler TimerEvent CommandManager CommandManager (Client class) depends on services provided by the other three server classes Client
  • 18. Aggregation Relation • Aggregation – A hollow diamond is attached to the end of the path to indicate aggregation. The diamond is attached to the class that is the aggregate. Aggregation provides a definitive conceptual whole part relationship
  • 19. Aggregation Example Explore other examples of Aggregation Is an aggregate of Zero or more of
  • 20. Composition: A Special Case of Aggregation Composition is shown as a solid filled diamond, with the diamond attached to the class that is the composite. Composition is a form of aggregation that requires coincident lifetime of the part with the whole and singular ownership; i.e. the part is owned by only one whole and is deleted when the whole is deleted + sendPacket(pk: const cmd_pktCToCHeader*) MQSendPacket MQWrite Is composed of
  • 22. Generalization/Specialization Relation • Generalization is shown as a solid-line arrow from the child (the more specific element) to the parent (the more general elementthis type of relationship is also called inheritance. • Should be used to define class hierarchies based on abstraction
  • 23. Generalization/Specialization Relation • Controllers and Monitors are examples of abstract classes Controller Brake Controller Engine Controller
  • 24. Multiplicity of Relationships Multiplici ties Meaning 0..1 zero or one instance. The notation n . . m indicates n to m instances. 0..* or * no limit on the number of instances (including none). 1 exactly one instance 1..* at least one instance
  • 25. Example of identifying Class Relations, Multiplicities, Attributes and operations
  • 26. The Vending Machine Analysis Level Class Diagram Ve nding Machin e C ontrolle r Num e ric Ke ypad W ire le ss Ke yboard C RT D isplay Mon e y D e te ction Hardware Mone y D ispe nse r Product D ispe n se r Product D atabase
  • 27. The Vending Machine Design Level Class Diagram +Sendmoneytocustomer() +Sendchangetocustomer() +calculatechangeexactchange() -attribute1 Money Dispenser +sendproducttocustomer() -attribute1 Product Dispenser +ShowmessagesonScreen() CRT Display +ReadoperatorInput()() +SendSignalstoVMCOntroller() WirelessKeyBoard +Readcustomerselction() +SendSignaltoVMController() NumericKeyPad +getproductID()() +getmoneyammount()() +sendquieries() +receiveresult() +sendresponse() DatabaseController +receiveinputsignalfromNumericPad() +RecieveinputsignalsfromWirelessKeyboard() +SendshowmessgaetoCRT() +DisableHWcomponents() +sendCommandtoProductdispense() +SendcommandtoMoneydispenser() +ReceiveMoneyforMoneyDectectorhw() -NPID -WKB -Moneydectorswitchoff -Money -Productdiableswicthoff -Moneydispenserswitchoff VmController -End1 * -End2 * -End3 * -End4 * -End5 * -End6 * -End7 * -End8 * -End9 * -End10 * -End11 * -End12 *
  • 28. Example of Software Architecture Using UML2 • SATELLITE CONTROL SYSTEM Architecture
  • 29. A Simple Example of Software Architecture Using UML2 • SATELLITE CONTROL SYSTEM Architecture