| |
Introduction to Objects:
The Progress of abstraction:.1 The OOP allows you to describe the problem in terms of the problem,rather than in term of the computer where the solution will run.
what is class:a class is really a data type.
what's object:1. Everything is an object.2. A program is a bunch of objects telling each other what to do by sending messages.3. Each object has its own memory made up of other objects.4. Every object has a type.5. All objects of a particular type can receive the same messages.
what's interface:We know to make a objects to work we should send the message to this objects,but each object can satisfy only certain requests.The requests you can make of an object are defined by its interface, and the type is what determines the interface.So we can say the interface is the type that the message that this kinds of the object can receive.
Why hidden implementation:The author suggesion that we should break up the playing field into class creators (those who create new data types) and client programmers(the class consumers who use the data types in their applications). The goal of the client programmer is to collect a toolbox full of classes to use for rapid application development. The goal of the class creator is to build a class that exposes only what’s necessary to the client programmer and keeps everything else hidden.
composition & aggregation:Your new class can be made up of any number and type of other objects, in any combination that you need to achieve the functionality desired in your new class. Because you are composing a new class from existing classes, this concept is called composition (if the composition happens dynamically, it’s usually called aggregation).
Inheritance:reusing the interface,as author had suggestion,a class is a type which could send out or receive some kinds of messages(by the interface).the inheritance which exactly means that get the same interface from the base class.
overriding:change the behavior of an existing base-class method.