Download - Introduction to Object Orientation
![Page 1: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/1.jpg)
Introduction to Object Orientation
Dr. Ahmed Youssef
![Page 2: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/2.jpg)
Object-Orientation It is a kind of thinking methodologyEverything in the world is an object;
Any system is composed of objects;
The evolution and development of a system is caused by the interactions among the objects inside or outside the system
2SWE 316- Ahmed Youssef
![Page 3: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/3.jpg)
Decomposition of the large problem into small parts that can be solved separately.
Why Object Oriented?
Large Application
3SWE 316- Ahmed Youssef
![Page 4: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/4.jpg)
Object-Oriented Concept
Object & Class InheritancePolymorphismEncapsulation
4SWE 316- Ahmed Youssef
![Page 5: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/5.jpg)
Everything in the world is an object
A flower, a tree, an animal A student, a professor A desk, a chair, a classroom,
a building A university, a city, a country The world, the universe A subject such as CS, SWE,
Math, History, …5SWE 316- Ahmed Youssef
![Page 6: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/6.jpg)
Object
6SWE 316- Ahmed Youssef
![Page 7: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/7.jpg)
Any system is composed of objectsA cultural systemAn educational systemAn economic systemAn Information systemA computer system
7SWE 316- Ahmed Youssef
![Page 8: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/8.jpg)
Procedure Program view
Main Program
Data
Procedure1
Procedure2
Procedure3
8SWE 316- Ahmed Youssef
![Page 9: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/9.jpg)
Main Program(Also a module)
Data
Data Data1
Module2
+
Data Data2
Module1
+
Data Data1
Procedure1Procedure2
The main program coordinates calls to procedures in separate modules and hands over appropriate data as parameters.
Procedure3
9SWE 316- Ahmed Youssef
![Page 10: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/10.jpg)
Object1
Data1+Procedures1
Data Data1Object3
Data3 + Procedures3
Object2
Data2 + Procedures2
Object4
Data4 + Procedures4
10SWE 316- Ahmed Youssef
![Page 11: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/11.jpg)
11
Classesobjects sharing common characteristics
containstate: attributes, fields, variables, data member
behavior: functions, methods
SWE 316- Ahmed Youssef
![Page 12: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/12.jpg)
Class
Person
Ahmed
Majed
Salem
Saad
12SWE 316- Ahmed Youssef
![Page 13: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/13.jpg)
Class
Student
Ahmed
Majed
Salem
Saad
13SWE 316- Ahmed Youssef
![Page 14: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/14.jpg)
Class
Tennis Player
Bandar
Mosaed
Nayef
Khaled
14SWE 316- Ahmed Youssef
![Page 15: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/15.jpg)
Class
Institute
Social Technology
Engineering
Science
Agricultural Technology
15SWE 316- Ahmed Youssef
![Page 16: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/16.jpg)
Class
NameAttributesOperations
…
16SWE 316- Ahmed Youssef
![Page 17: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/17.jpg)
ClassStudent
StudentIDFirstNameLastNameAddressetc…
RegisterForCourseDropCourseetc...
17SWE 316- Ahmed Youssef
![Page 18: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/18.jpg)
ClassTennis Player
FirstNameLastNameNationalityRankingetc…RegisterForTournamentetc...
18SWE 316- Ahmed Youssef
![Page 19: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/19.jpg)
Class Car
Car Reg. NumberMakerModelColoretc…AccelerateStopetc...
19SWE 316- Ahmed Youssef
![Page 20: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/20.jpg)
ClassAirplane
Plane NumberManufacturerModeletc…TakeOffLandingetc...
20SWE 316- Ahmed Youssef
![Page 21: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/21.jpg)
21
Object & Class
SWE 316- Ahmed Youssef
![Page 22: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/22.jpg)
Object & ClassStudent
StudentIDFirstNameLastNameAddressetc…
RegisterForCourseDropCourseetc...
Student
Ahmed
Majed
Salem
Saad
22SWE 316- Ahmed Youssef
![Page 23: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/23.jpg)
Object & ClassStudent1
B4555555AhmedAlfgdfg7146 sdasds7etc…
RegisterForCourseDropCourseetc...
Student
Ahmed
Majed
Salem
Saad
23SWE 316- Ahmed Youssef
![Page 24: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/24.jpg)
Student1
B4555555AhmedAlfgdfg7146 sdasds7etc…
RegisterForCourseDropCourseetc...
Student
StudentIDFirstNameLastNameAddressetc…
RegisterForCourseDropCourseetc...
24SWE 316- Ahmed Youssef
![Page 25: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/25.jpg)
Building Class
SWE 316- Ahmed Youssef 25
Any Thing
Attributes
Behavior
![Page 26: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/26.jpg)
Student- Class
Lname string Student_ID
string
Levelint
Telstring
Gender string
Programstring
Print_infoInput: -return: voidUpdate_i
nfoInput: name or IDReturn : void
Fname string
26
![Page 27: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/27.jpg)
MainClass
StudentClass
3.
Man
age
obje
ct
1. Create objects from
class
Obj1
Obj2
Obj3
Obj4
2. objects
27
![Page 28: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/28.jpg)
Student Class
Instance variable
Constructor
Constructor
28
![Page 29: Introduction to Object Orientation](https://reader036.vdocuments.us/reader036/viewer/2022081421/56815ab0550346895dc85830/html5/thumbnails/29.jpg)
Method
OverloadedMethod
Student Class
29