Interduction to Objects.
1.characteristics -- OO.
a. Everything is an object.
b. A program is a buch of objects telling each other what to do by sending msg.
c. Each objects has its own memory made up of other objects.
d. Every objects has a type.
e. All objects of a particular type can receive the same message.
2. Hidden implementation
a. public
b. pravite
c. protect.
3. Interchangeable objects with polymorphism.(Picture 1)
To draw a sharp, whatever we want,just tell the tool circle or square or else.
It would draw itself because it know how to draw.
draw is a function of all sharp. That's the thinking way in the real world.
4. Design.
Keep thinking as below:
1. What are the object? How do you partition your project into its component parts?
2. What are their infterface? What message do you need to be able to send to each object?
Phase 0: Let's make a plan
Phase 1: What re we making?
Phase 2; How did we build it?
Phase 3: Let's build it.
Phase 4: Iteration
Java Vs C++
C++ is faster than Java. about 20 to 50 times.
Java's development is faster than C++.
-----------------Kevin's understand-------------------
OO thinkng is just a way like we do in the real world.
Image it, every people is an object.(a); When we hung out, we are talking and laughing(b).
Everyone is a depandent person, who must be different in some way.(c) We all have a type, man or woman.(d)
We all would laugh when seeing a funny view.(e)
To compare with C++, Java is much slower than it.
Java is just like VB+, development just in time, but much powerful than VB,especially in web development.