uml diagrams: class diagrams the static analysis model instructor: dr. hany h. ammar dept. of...
TRANSCRIPT
![Page 1: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/1.jpg)
UML Diagrams: Class Diagrams
The Static Analysis Model
Instructor: Dr. Hany H. Ammar
Dept. of Computer Science and Electrical Engineering, WVU
![Page 2: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/2.jpg)
outline
The Requirements Model and the Analysis model The Static Analysis Model – The Analysis Process
The Conceptual Level - Identifying the Classes of Objects (Step 6 Requirements Elicitation Process: Identify Initial Analysis Objects)
The Analysis Level – Identifying Class relationships, class attributes, and class operations
Examples
![Page 3: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/3.jpg)
UML Development - Overview
PROGRAM
ACTORS
ANALYSISSpecify Domain Objects
Detailed DESIGN
IMPLEMENTATION
DATA
DICTION
ARY
TimeUSE CASES
ANALYSISCLASS DIAGRAM(S)
IMPLEMENTATIONActivity DIAGRAMS
System/ObjectSEQUENCEDIAGRAMS
OPERATION CONTRACTS
StateChart DIAGRAMs
DEPLOYMENT DIAGRAMSUBSYSTEM CLASS/OR COMPONENT
DIAGRAMS
Architectural DesignIncludeDesign Objects
ObjectDesign
SCENARIOS
REQUIREMENTSELICITATION
DESIGN DIAGRAMS
IMPLEMENTATIONCHOICES
DESIGN SEQUENCE DIAG.
RequirementsEngineering
![Page 4: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/4.jpg)
The Requirements Model and the Analysis Model
Static Analysis Dynamic Analysis
Functional/ NonfunctionalRequirements
Use Case Diagrams/Sequence Diagrams(the system level)
- Class Diagrams- State Diagrams/Refined Sequence Diagrams (The object level)
Requirements ElicitationProcess
The AnalysisProcess
![Page 5: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/5.jpg)
Static ModelingClass DiagramsA 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
![Page 6: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/6.jpg)
outline
The Requirements Model and the Analysis model The Static Analysis Model – The Analysis Process
The Conceptual Level - Identifying the Classes of Objects (Step 6 Requirements Elicitation Process: Identify Initial Analysis Objects)
The Analysis Level – Identifying Class relationships, class attributes, and class operations
![Page 7: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/7.jpg)
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.
![Page 8: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/8.jpg)
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 external classes representing the actors
![Page 9: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/9.jpg)
Context Class DiagramDefines 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
<<external>>Other Actors
![Page 10: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/10.jpg)
![Page 11: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/11.jpg)
![Page 12: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/12.jpg)
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 stereotype words <<external>> or <<actor>> are used to specify external classes or packages
Names of external packages should reflective of the classes defined in the package
![Page 13: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/13.jpg)
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
![Page 14: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/14.jpg)
Example of System packages
![Page 15: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/15.jpg)
![Page 16: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/16.jpg)
outline
The Requirements Model and the Analysis model The Static Analysis Model – The Analysis Process
The Conceptual Level - Identifying the Classes of Objects (Step 6 Requirements Elicitation Process: Identify Initial Analysis Objects)
The Analysis Level – Identifying Class relationships, class attributes, and class operations
![Page 17: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/17.jpg)
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
![Page 18: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/18.jpg)
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
DetailedAttributes,Data types,And operations Are defined/refinedDuring design
![Page 19: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/19.jpg)
Identify Class relationships
PilotCommands
AircraftControl
Association
Aggregate/Whole
Aggregated/Part
Aggregation (hollow diamond)/Composition (solid diamond)
Child
Parent
Generalization
![Page 20: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/20.jpg)
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,
![Page 21: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/21.jpg)
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
![Page 22: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/22.jpg)
Dependency: A Special Case of AssociationDependency
RequestHandler ResponseHandlerTimerEvent
CommandManager
CommandManager (Client class) depends on services provided by the other three server classes
Client
![Page 23: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/23.jpg)
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
![Page 24: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/24.jpg)
Aggregation Example
![Page 25: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/25.jpg)
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*)
MQSendPacketMQWrite
![Page 26: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/26.jpg)
Composition example
![Page 27: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/27.jpg)
Aggregation vs Composition
![Page 28: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/28.jpg)
Generalization/Specialization Relation Generalization is shown as a solid-line
arrow from the child (the more specific element) to the parent (the more general element) this type of relationship is also called inheritance.
Should be used to define class hierarchies based on abstraction
![Page 29: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/29.jpg)
Generalization/Specialization Relation
![Page 30: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/30.jpg)
Multiplicity of Relationships
Multiplicities
Meaning
0..1zero 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 (the default)
1..* at least one instance
![Page 31: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/31.jpg)
Example of identifying Class Multiplicities,Attributes and operations
![Page 32: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/32.jpg)
![Page 33: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/33.jpg)
![Page 34: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/34.jpg)
outline
The Requirements Model and the Analysis model The Static Analysis Model – The Analysis Process
The Conceptual Level - Identifying the Classes of Objects (Step 6 Requirements Elicitation Process: Identify Initial Analysis Objects)
The Analysis Level – Identifying Class relationships, class attributes, and class operations
Examples
![Page 35: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/35.jpg)
Recall the Digital Sound Recorder Case Study Requirements Model
![Page 36: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/36.jpg)
The Sound RecorderAnalysis Level Class Diagram
![Page 37: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/37.jpg)
Emergency Monitoring System
![Page 38: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/38.jpg)
![Page 39: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/39.jpg)
![Page 40: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/40.jpg)
The ATM Banking System
![Page 41: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/41.jpg)
![Page 42: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/42.jpg)
![Page 43: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/43.jpg)
Example of Software Architecture Using UML2
SATELLITE CONTROL SYSTEM Architecture
![Page 44: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/44.jpg)
A Simple Example of Software Architecture Using UML2
SATELLITE CONTROL SYSTEM Architecture
![Page 45: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/45.jpg)
Example: Auto Cruise Controland Monitoring (The Cruise Cont. Subsys)
![Page 46: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/46.jpg)
Example: Auto Cruise Controland Monitoring (The Monitoring Subsys)
![Page 47: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/47.jpg)
![Page 48: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/48.jpg)
![Page 49: UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU](https://reader035.vdocument.in/reader035/viewer/2022062423/56649eb05503460f94bb564f/html5/thumbnails/49.jpg)
Example of a Design Level Class Diagramhttp://www.codeproject.com/library/WinSNMPWrapper.asp?df=100&forumid=216441&exp=0&select=1259211