The eighth chapter, object-oriented design

Source: Internet
Author: User

The eighth chapter, object-oriented design

The basic features of object-oriented programming are: 1, encapsulation: encapsulation refers to the object-related information and behavior state bundled into a unit, the object is encapsulated into a specific class. Encapsulation hides the concrete implementation of an object, and when you want to manipulate the object, you only need to invoke the method, rather than the concrete implementation of the method. 2, Inheritance: One class inherits another class, the inheritors can obtain all the methods and properties of the inherited class, and can add new methods according to the actual needs or overwrite the methods in the inherited class, the inheritors is called the parent class or the superclass, the inheritors is called the subclass or the export class, and the inheritance improves the reusability of the program code. A subclass in Java can inherit only one parent, and the object class is the ultimate parent class for all classes. 3, polymorphism: polymorphism refers to the same behavior of different objects to the same thing, a Class A can point to its own class and its export class, an interface can point to its interface implementation class, in the method parameters, the use of polymorphism can improve the flexibility of the parameters.

Object-oriented design and object-oriented differences:

(1) In the focus, object-oriented analysis focuses on understanding the problem, describing what the software does, while the object-oriented design focuses on understanding the solution, describing how the software should be done.

(2) Object-oriented analysis generally only consider the ideal hungry design, do not care about the technical and implementation level of detail, and object-oriented design needs to get more specific, more detailed, closer to the real code design.

(3) The object-oriented analysis phase focuses on describing the behavior of the object, while the object-oriented design phase focuses on describing the properties and methods of the object in the design results.

(4) Object-oriented analysis focuses only on functional requirements, while object-oriented design focuses on functional requirements and non-functional requirements.

(5) The system model produced by object-oriented analysis is usually small, and the system model produced by object-oriented design is large in scale and content is more detailed and complete.

The eighth chapter, object-oriented design

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.