Object Orientedprogrammingconcepts 101114113502 Phpapp02
Object Orientedprogrammingconcepts 101114113502 Phpapp02
Programming
Concepts
2000. 4. 14.
Kwang Shin Oh
http://raytrust.pe.kr
[email protected]
Http://raytrust.pe.kr
OO Concept
if youve never programmed using
an object-oriented language before
Object-Oriented Concepts 2
Http://raytrust.pe.kr
What is an
Object?
objects are key to understanding
object-oriented technology
many examples of real-world objects
Object-Oriented Concepts 3
Http://raytrust.pe.kr
What is an Object?
for example
Object-Oriented Concepts 4
Http://raytrust.pe.kr
What is an
Object?
software objects
Definition : An object is a
software bundle of variables
and related methods
Object-Oriented Concepts 5
Http://raytrust.pe.kr
What is an
Object?
represent real-world objects using
Visual Representation
of a Software Object
Public
API
Private
Implementatio
n
Details
software objects
also use software objects to
model abstract concepts
Object-Oriented Concepts 6
Http://raytrust.pe.kr
What is an
Object?
software object that modeled
Object-Oriented Concepts 7
Http://raytrust.pe.kr
What is an
Object?
these variables and methods are
as a Software Object
brake
90 rpm
5th gear
change cadence
Object-Oriented Concepts 8
Http://raytrust.pe.kr
What is an
Object?
anything that an object does not
Object-Oriented Concepts 9
Http://raytrust.pe.kr
What is an
Object?
the objects variables make up the
10
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Object?
encapsulation is used to hide
11
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Object?
in software programs
12
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Object?
often, for implementation or
efficiency reasons
13
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Object?
The Benefits of Encapsulation
Modularity
14
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Object?
Information hiding
15
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a
Message?
a single object alone
16
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a
Message?
software objects interact and
Object B
Object A
17
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a
Message?
sometimes the receiving object needs
18
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a
Message?
three components are enough
Your Bicycle
You
19
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a
Message?
The Benefits of Messages
20
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
in the real world
21
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
22
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
in object-oriented software
23
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
24
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
you
25
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
system
to make it do domething
26
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
27
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
class methods can only operate on
class variables
28
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
29
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
however, in software
because
30
Object-Oriented Concepts
Http://raytrust.pe.kr
What is a Class?
The Benefit of Classes
reusability
31
Object-Oriented Concepts
Http://raytrust.pe.kr
What is
Inheritance?
generally speaking, objects are
32
Object-Oriented Concepts
Http://raytrust.pe.kr
What is
Inheritance?
object-oriented systems
for example
33
Object-Oriented Concepts
Http://raytrust.pe.kr
What is
Inheritance?
in object-oriented terminology
34
Object-Oriented Concepts
Http://raytrust.pe.kr
Mountain Bikes
Racing Bikes
Tandem Bikes
What is
Inheritance?
Bicycles
35
Object-Oriented Concepts
Http://raytrust.pe.kr
What is
Inheritance?
each subclass inherits state (int the
36
Object-Oriented Concepts
Http://raytrust.pe.kr
What is
Inheritance?
however, subclasses are not limited
37
Object-Oriented Concepts
Http://raytrust.pe.kr
What is
Inheritance?
subclasses can also override inherited
38
Object-Oriented Concepts
Http://raytrust.pe.kr
What is
Inheritance?
not limited to just one layer of
inheritance
the inheritance tree, or class
hierarchy
39
Object-Oriented Concepts
Http://raytrust.pe.kr
What is
Inheritance?
The Benefits of Inheritance
40
Object-Oriented Concepts
Http://raytrust.pe.kr
What is
Inheritance?
abstract classes
41
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Interface?
in English
remote control
English language
42
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Interface?
protocol of behavior enforced in the
military
interface
43
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Interface?
interfaces are probably most
44
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Interface?
the bicycle class and its class
hierarchy defines
for example
45
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Interface?
to set or get this sort of information
46
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Interface?
to work within the inventory program
47
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Interface?
The Benefit of Interfaces
Capturing similarities
Declaring methods
48
Object-Oriented Concepts
Http://raytrust.pe.kr
What is an
Interface?
Revealing API
49
Object-Oriented Concepts
Http://raytrust.pe.kr
Reference
The JavaTM Tutorial
Trail
Learning the Java Language
Lesson
Object-Oriented Programming Concepts
50
Object-Oriented Concepts