Download presentation
Presentation is loading. Please wait.
1
Class Diagram
2
Definition depict the classes within a model
classes have attributes (member variables), operations (member functions) and relationships with other classes آزمايشگاه سيستم هاي همشمند
3
Class Diagram Class Relationships Class name Attribute Operation
Generalization Association Aggregation Dependency
4
Class It’s a rectangle divided into three compartments. Name
Attributes Operations آزمايشگاه سيستم هاي همشمند
5
Class Name Required Appears in the top-most compartment unique
آزمايشگاه سيستم هاي همشمند
6
Attributes property of a class, describes the object being modeled.
Person name : String address : Address birthdate : Date ssn : Id property of a class, describes the object being modeled. appear in the second compartment آزمايشگاه سيستم هاي همشمند
7
Attributes Visibility Name Data Type [default value]
Public + Private – Protected # Package ~ Name Data Type [default value] Visibility name : type = initial value {constraints} آزمايشگاه سيستم هاي همشمند
8
Attributes Derived attribute: Example: age and birth date / age : Date
can be computed from other attributes doesn’t actually exist. designated by a preceding ‘/’ Example: age and birth date / age : Date +Wieght : int = 850 Person name : String address : Address birthdate : Date / age : Date ssn : Id آزمايشگاه سيستم هاي همشمند
9
Operation the class behavior
Person name : String address : Address birthdate : Date ssn : Id eat sleep work play the class behavior signature: name, type, and default value of all parameters, and, a return type.
10
Operation Operation name Arguments Return type Name Type
آزمايشگاه سيستم هاي همشمند
11
Depicting Classes آزمايشگاه سيستم هاي همشمند
12
Example
13
Class types Boundry (usecase – actor): boundary of the system and other system or user Entity (Table): has data Control (usecase): few attribute
14
Relationships Relationships Generalization Association Aggregation
Dependency
15
Generalization A relationship between a general thing sand a more specific kind of that thing “is-a-kind-of” relationship
16
Association A structural relationship that specifies that objects of one thing are connected to objects of other Communicate Multiplicity One-to-One Many-to-One Many-to-Many آزمايشگاه سيستم هاي همشمند
17
Association
18
Reflexive Association
LinkedListNode next previous
19
Reflexive Association
20
Aggregation "has a" association relationship
represents a part-whole or part-of relationship when a class is a collection or container of other classes the contained classes do not have a strong life cycle dependency on the container
21
Aggregation Car Engine Transmission
22
Composition "owns a” association relationship
Composition usually has a strong life cycle dependency between instances of the container class and instances of the contained class
23
Composition
24
Dependency Change in specification of one class can change the other class. This can happen when one class is using another class.
25
Examples
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.