0% found this document useful (0 votes)
7 views16 pages

Course 05

Uploaded by

vokoso3536
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views16 pages

Course 05

Uploaded by

vokoso3536
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Democratic and Popular Republic of Algeria

Ministry of Higher Education and Scientific Research


University of Relizane
Faculty of Science and Technology
Department of Computer Science

3rd year Computer Science

Software Engineering
Class

Dr. S. A. Medjahed 1
Introduction
•As we mentioned in the previous chapter, the use case diagram shows the
major functionalities of the system and the actors triggering them. The class
diagram shows us the internal structure of the system. It provides an
abstract representation of the system objects that will interact to realize the
use cases.

•This is a static view, because the temporal factor in the behavior of the
system is not taken into account. The class diagram models the concepts of
the application domain by presenting the classes of the system and their
relationships.

•The main elements of this static view are classes and their relationships:
association, generalization, and several types of dependencies.

Dr. S. A. Medjahed 2
Class
•A class is the abstract description of a set of objects that are part of the
same domain (possessing the same characteristics).
•A class is represented by a workbook divided into three parts:
The name of the class that begins
always with a capital letter.
The attributes that represent the data Class Name
of the object. Attributes

The operations that represent the Operations

behavior of an object

Dr. S. A. Medjahed 3
Encapsulation
• The user can use a class (create/manipulate objects) without knowing the body of the class. If the class is properly defined,
the user cannot violate the integrity of the object [e.g., transform an ordered list into an unordered list].

• The implementation is hidden and not accessible to the user.

Dr. S. A. Medjahed 4
The Legacy

• An object of the class "Motor Vehicle" inherits the properties of the class "Vehicle". So, such an object has a weight, a size and
a price. In addition, it can stop and start. In addition, it has a power and a top speed (properties that vehicles without an
engine do not have).
• VehicleMotor " is said to be derived (or inherited) from the class "Vehicle".

Dr. S. A. Medjahed 5
Polymorphism
• These are multiple forms for the same operation.
• Example: It is impossible to calculate the surface area of a graphic shape if we have no information
about this shape [the graphic shape class is therefore an abstract class].

Dr. S. A. Medjahed 6
Class Diagram
A class diagram shows the static structure of a system. It allows the visualization of classes and the relationships between them
. Its purpose is to explain what to achieve rather than to explain how to achieve it.

Dr. S. A. Medjahed 7
Example of a class
Student

- Student code : int "id" Visibility :


- nameEtud : String
- firstnameEtud:String
- private: accessibility only by the object.
+ age:int
- year:int =2021
Attributes are generally of “private”
+ calculation ()
visibility.
+ majAnnee () + public: accessible by any other object.
Operations are generally “public”.
# protected: accessible by objects of
subclasses (derived classes) of the initial
class.

Dr. S. A. Medjahed 8
Signature of a method
The Signature of a method includes the list of arguments with their type and the type returned by the operation

• example: calculateAge ( dateNaiss : Date): int


• Polymorphism is the definition of multiple signatures for the same operation. Example:
• calculationAge ( dateBirth : Date): int
• calculateAge () : void

Dr. S. A. Medjahed 9
Association
• Associations are binary. An association can only be named using roles.

Dr. S. A. Medjahed 10
Multiplicity
Each association termination can define the following multiplicities:
• 1: This is the default value for any ending that specifies that there is one and only one
element.
• 0..1: Possibility of having 0 or 1 element.
• 1..*: Possibility of having 1 to n elements.
• 0..*: Possibility of having 0 to n elements.
• n: Sets a specific number of elements.
• n..m: Defines a specific range of elements.
• * : equivalent of 0..*

Dr. S. A. Medjahed 11
Example of multiplicity

Dr. S. A. Medjahed 12
Association attribute

Dr. S. A. Medjahed 13
Reflective association

Dr. S. A. Medjahed 14
Legacy

Dr. S. A. Medjahed 15
Aggregation and Composition
• Aggregation

• Composition

Dr. S. A. Medjahed 16

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy