Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
16 views

Object-Oriented Analysis and Design

The document discusses class diagrams and UML. It defines classes, objects, attributes, actions and relationships. It explains how to identify classes and draw class diagrams, including determining classes, associations, multiplicity and inheritance.

Uploaded by

Arthur Wallker
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Object-Oriented Analysis and Design

The document discusses class diagrams and UML. It defines classes, objects, attributes, actions and relationships. It explains how to identify classes and draw class diagrams, including determining classes, associations, multiplicity and inheritance.

Uploaded by

Arthur Wallker
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Object oriented Analysis and

Design
Lecture 3

Methodology and UML


Dr.Abdualmajed Alkhulaidi
Associate professor at Sana’a University
Doctor of Philosophy in Software
Engineering
The Class Diagram

Class:
Is a group of objects having the same attributes and
processes.
Class:
Is a set of similar things in their properties and behavior.
Example: (animals, transportation, plants, students, .....).
Object :
It is all that you look at around you is an object.
Such as car, home, computer, etc.
The shape shows the object and its
attributes and actions
The object and ( attributes & actions)
If we replace the object of the person (Khalid)
here with any other object, we will find
attributes and actions will be with him and will
change depending on the type of object itself,
and here we say that the object of whatever
kind, will consist of attributes and actions.
Object Attributes
Object properties: Object specifications.
These things come in the format name = value
what does that mean?.
Now if you want to buy a car, you will ask about its price, color, and other
specifications that are of interest to you during the purchase. As we said that the car is
an object, its price,
Properties, for this object (car), and to illustrate the intended use of the formula
:name = value, note how to set the specifications below
car.color = red
car.price = 66500
We conclude from the above that color represents the property name.
And red represents the value of the property.
The same applies to the price property.
Object Actions
Here we will talk about the second component
of the object, actions
You may find them in the name of Behavior,
Methods, and others.
Object Actions:
It is the things that the object does.
Class and object and the relationship
between them
Class and object and the relationship
between them
We conclude that the object is a copy of class,
and this is the relationship.
That is, Class may create several copies of it.
All these copies are objects.
Programmatic representation for both
Class and Object in java
class Person
{
public String name;
public int age;
public boolean gender;
public void eat() {...}
public void sleep() {...}
public void run() {...}

}
Code showing object creation
Person khaled = new Person();
khaled.name = “Khaled”;
khaled.age = 25;
khaled.gender = true;
The Class Diagram

Definition
Is one of the UML schemes by which the system
structure is described by showing system layers,
properties, processes, and relationships
between objects.
The Class Diagram
Things can be placed within Classes.
The Class diagram function comes to illustrate
these classes and association among them.
For each class:
• -class name
• -Attributes
• - Methods and sometimes we call them
operations.
When to use a class diagram?
• Class schemas are used in almost all object-
oriented programming designs.
• They are used to describe system classes and
their relationship to each other.
Class Diagram
Thus, the class can be represented in one of the
following ways:
How can I identify classes?
We can follow the method used in the
determination of actors and use cases, by
creating a table helps in the identification of
items and the analysis of functional
requirements.
Identifying Classes
Number Requirements Class
1 At the beginning of the school year, student
the student advances to the
manager to join the school.

2 The manager considers that the Manger


student meets the admission
requirements, and then
determines the level, the class, and
the amount of the fees from the
student, divided by installments.

3 The student shall obtain the Register


approval of the Director and
submit it to the Registration Unit
Officer to record the basic student
data, which includes the student
number, which is used in any
process on the student's data.

4 The Registrar shall instruct the Courses


student to go to the specified Teacher
chapter and define the material to
be studied and identify the teacher
of each subject
How to Draw a Class diagram?
First: Determine the classes in the system and
each class should be considered to the
operations and attributes
Second:
Select the states of the classes that will interact
with each other.
Associations between classes
Multiplicity between classes
Multiplicity can take between classes in one of
the following formats:
Examples

• Each chef is responsible for workers .

• Each teacher has one or more students


Follow
attributes & operations can be
In one of the following cases:
• Public ( + )
• Private ( – )
• Protected ( # )
Inheritance between the classes

You might also like