Object-oriented Mind mapping

Source: Internet
Author: User

Recently in the study of object-oriented process of deep feelings, so organized a number of mind mapping to deepen understanding.

1. Object Oriented thinking

2. Object-Oriented Architecture

3. Object-oriented processes

Some points of knowledge:

The difference between 1.OO and procedural programming: in OO design, attributes and behaviors are contained in an object (called encapsulation), whereas in procedural programming (structured design), attributes and behaviors are separate.

2. in OO design terminology, data is called a property , and behavior is called a method .

3. The Get methods and settings method provides a controlled access to the data of an object, and the methods of getting and setting are sometimes referred to as access methods and modification methods.

4. A class is a template for an object. When an object is created, it is called an instantiation of the object . You must design the class before you create the object.

5. the data for a class is represented by a property . Each class must define a property to store the state of individual objects instantiated by this class.

6. to implement data hiding , all attributes should be declared private. In most OO languages, methods in an interface are specified as public .

7. a superclass (or parent class or base class) contains properties and behaviors that inherit from all subclasses (or derived classes) of that class.

8. in most OO languages, a class can have only one parent class- single-inheritance . Some languages, such as C+ +,allow a class to have multiple parent classes- multiple inheritance .

9. Initialization order: The initialization order of the ① object: static member, non-static member, constructor method, and the order of the constructor method in ② inheritance: The late Father class, then sub-class.

Ten. if a subclass inherits an abstract method from a superclass , it must provide a concrete implementation for this method.

11.a. A constructor (constructor) is a method with the same name as the class in which it is located, and the method does not provide any return type. The constructor is the entry point for the class, and the object is constructed from this. The constructor is ideal for initializing . The new keyword is used to instantiate the class and allocate the required memory.

Cabbies Mycabbie = new Cabbie ();

b. Initialization is a common feature of constructor completion. If a constructor is not provided for the Cabbie class, it is automatically inserted under the default constructor

Public Cabbie ()

{

Super ();

}

C. if there are attributes in a class, it is often good practice to initialize these properties in the constructor.

D. using multiple constructors (overloaded methods): use different signatures for functions. Signature = method name + parameter list

Public String getrecord (int key)

E. how the superclass is constructed : ① calls the constructor of the class superclass, ② initializes the class properties of the object, ③ executes the rest of the code in the constructor

implementation details are hidden from the user. Any part of the implementation can be changed without affecting the user interface of the class. The interface contains syntax for calling a method and returning a value. If the interface does not change, the user is not concerned about whether the implementation has changed.

Objects Persistence (objectpersistence) refers to the state of the saved object so that it can be recovered and used later. Scenario ①, save the object to a flat file (using a proprietary serialization technology or an XML model that can span multiple platforms and languages), and the schema ②, written to the relational database.

The goal of 14.OO design is to design abstract, highly reusable classes.

provide the minimum interface to the user whenever possible. Determining the final interface is an iterative process.

exception Granularity : You can capture exceptions of different granularity. You can catch all exceptions or you can check only certain exceptions.

The.this: The keyword is a reference to the current object, and Super: Represents a reference to the parent class object of the current object.

. Static property : Allocates a memory for this property to all objects instantiated by this class, which are shared by all objects of the class. This is somewhat similar to the concept of global data.

The operator overload (operator overloading) can change the meaning of an operator, such as "+", which can be used as a plus or as a string concatenation. Most OO languages do not allow operator overloading.

20.a. The most important reason for inheritance and composition may be object reuse . Inheritance--is-a relationship; combination--has-a relationship.

b. Inheritance is a method in which subclasses use the parent class, and polymorphism is the method by which the parent class uses subclasses. the difference between overloading, rewriting, inheriting, polymorphism

Triangle tri = new Triangle (); Inherited

Shape shape = new Triangle (); Polymorphic

C. Overloading is a method in which a series of identically named parameters differs in a class, whereas overriding (override) refers to the implementation of a subclass that overrides the implementation in the parent class, inheriting the method of implementing the parent class.

D. The Object class is the base class for all classes in Java and. Net environments.

each new inheritance relationship establishes a new context for the use of the inherited method. It is necessary to consider a complete test strategy for each of these contexts-testing the new code.

one way to create reusable code is to create a framework . The idea of the framework revolves around the principle of Plug and play and reuse. You can use interfaces and abstract classes to create frames.

. Contract (contract): Requires developers to adhere to the mechanisms required by the application programming interface specification. In . Net , there are two ways of implementing contracts : abstract classes and interfaces.

The inheritance is a strict is-a relationship, but the interface is not. Interfaces can span multiple classes.

25.a. XML(Extensible Markup Language) is a standard mechanism for defining and transmitting data between different systems, and the object-oriented data definition language .

b. The HTML represents the data , theXML describes the data (formatted data), and the data can be formatted with CSS (focusing on the displayed style). compared to HTML ,XML provides a legitimacy check-DTD(Document Type Definition). To be able to validate the document to make the XML document More robust, you need to define the markup in the DTD that describes the data.

The classes that contain abstract methods are necessarily abstract classes , and the methods of abstract classes are not necessarily abstract methods. Abstract classes cannot be instantiated. Abstract classes cannot be sealed or static, abstract class quilts inherit and implement its methods.

Only virtual methods or static methods can be overridden, and abstract methods can be seen as virtual methods that do not implement the body. The abstract method of the base class requires subclasses to implement, and the virtual method is implemented in the base class, and whether the subclass chooses to overwrite the base class method depends on the subclass's requirements. The difference between abstract and virtual methods

three main features of object-oriented : ① Encapsulation : Ensure the integrity and security of the object's own data; ② inheritance : Establish the relationship between classes, realize code reuse and facilitate the expansion of the system; ③ polymorphism : The same method call can implement different implementations. Object-oriented polymorphism

Seal Class is one of the classes, modified with sealed , and cannot be used as a base class. Therefore, it cannot be an abstract class. Sealed classes are primarily used to prevent derivation.

Object-oriented Mind mapping

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.