Lect01 PDF
Lect01 PDF
Request lt.on();
Class User
Class Creator (Client Programmer) 4
Engine
Wheel[4]
Implementation
Door[2]
etc...
a Circle
draw()
Shape a Square
erase()
a Line
An Amazing Trick
void doStuff(Shape s) {
s.erase();
// ...
s.draw();
}
Object-Oriented programs
object me
ss
ag
e
object
message
e
ag
ss
object me
Things Things
that that
Change Stay the
Same
• In the design
• At compile-time
• At run-time • Hard part: decomposing
• In the environment system into objects
• Etc. • What interfaces do you
need?
10
11 11
• Error handling
wired in
• Can’t ignore the error
• Recover to a known good state
• Java stands out: you’re forced to
use exceptions
13
Multithreading
• For responsiveness
• For running multiple tasks (animation &
networks)
• We’ll cover this in Chapter 14
14
Persistence
• Objects that live between program
invocations
• Convenient, Java has object serialization
built in, supports “lightweight
persistence.” Primarily added to support
remote method invocation (RMI) across
networks.
• JDBC could be thought of as
another form of persistence
• JavaSpaces, further
evolution
15
17
Summary
Procedural Java
Abstract data type
Data Data
“Message”
Function Function Member
or
function
“Request”
Function or
Function
“method”
Function Function
“Encapsulation” (?) 18
Click Here
to Return to Home Page
19