The beauty of design patterns learning (II): in the end what is object-oriented?

Object-oriented mentioned, I believe many people are not familiar with, can casually tell the object-oriented four characteristics: encapsulation, abstraction, inheritance, polymorphism. In fact, the concept of object-oriented content that contains more than that.

What is object-oriented programming and object-oriented programming language?

Abbreviation of object-oriented programming is OOP, stands Object Oriented Programming. Correspondingly, the abbreviation is object oriented programming language OOPL, stands Object Oriented Programming Language.

Object-oriented programming has two very important, very basic concept, that is class ( class) and objects ( object). This concept first appeared in two 1960years, in Simulathe first use of this programming language. And the concept of object-oriented programming is used for the first time in Smalltalkthis programming language. SmalltalkIt is considered to be object-oriented programming language on the first real sense.

What language is considered object-oriented programming language? If you have to give a defined, can use the following two sentences.

  • Object-oriented programming is a programming paradigm or programming style. It is a generic object as tissue or a basic unit of code, and encapsulation, abstraction, inheritance, polymorphism four properties, as the cornerstone of code design and implementation.

  • Support object oriented programming language grammar classes or objects mechanism, and a ready mechanism syntax, can easily realize the four characteristics of object-oriented programming (encapsulation, abstraction, inheritance, polymorphism) programming language.

In general, object-oriented programming is carried out through the use of object-oriented programming language, however, not object-oriented programming language, we can still be object-oriented programming. Conversely, even if we use object-oriented programming language, write code that is not necessarily object-oriented programming style, there may be process-oriented programming style.

How to determine whether a programming language is object-oriented programming language?

In fact, for what is object-oriented programming, object-oriented programming language what is and is not an official, uniform definition. Moreover, from 1960the year that 60years ago the birth of object-oriented programming began, these two concepts in non-stop evolution, therefore, can not give a clear definition, there is no need to give a clear definition.

In fact, object-oriented programming literally, according to the simplest and most primitive way to be understood that the object or class as a basic unit of organization codes, one for programming or programming paradigm programming style is not necessarily required package abstraction, inheritance, polymorphism support these four characteristics. However, during the process of object-oriented programming, people kept summary found that with these four characteristics, we can more easily achieve a variety of object-oriented code design ideas.

In fact, as long as the concept of a programming language syntax support class or object, and as a basic unit of organization code, it can be roughly thought it is the object-oriented programming language. As to whether there are existing mechanisms for grammar, fully supports the four major characteristics of object-oriented programming, whether on the four properties have a choice and optimization, can not be judged as a standard. Based on this, only the previous statement, in accordance with the strict definition, many languages can not be regarded as an object-oriented programming language, but not strictly in accordance with the definition, it is now the most popular programming languages are object-oriented programming language.

What is the object-oriented analysis and object-oriented design?

Indeed, with object-oriented programming is often put in terms of there are two concepts together, that is the object-oriented analysis ( OOA) and object-oriented design ( OOD). Object-oriented analysis abbreviation OOA, stands for Object Oriented Analysisthe initials of object-oriented design is; OOD, stands Object Oriented Design. OOA, OOD, OOPThree three phases together is the object-oriented analysis, design, programming (to achieve), object-oriented software development is just to go through.

The reason preceded by "object-oriented" words, because we are around the object or class to do requirements analysis and design. The final output analysis and design phases are two classes of design, including the dismantling program is for which classes, each class has attributes which methods, how the interaction between classes and so on. They are more specific than other analysis and design, more floor, closer to coding, more smooth transition to object-oriented programming links. This is also the object-oriented analysis and design, and other analysis and design the biggest difference.

Simply speaking, object-oriented analysis is to figure out what to do, object-oriented design is to figure out how to do object-oriented programming is to analyze results of the design process and translated into code.

What is UML? Do we need UML?

Talked about object-oriented analysis, design, programming, I have to mention another concept, that is, UML( Unified Model Language), Unified Modeling Language. Many explain or object-oriented design patterns book, used it to express design ideas drawing or object-oriented design patterns.

UMLIt is a very complex thing. It includes not only the class diagram we often mentioned, as well as use case diagram, a sequence diagram, an activity diagram, a state diagram, like components FIG. In my opinion, even if only use class diagrams, learning cost is very high. He said SIN relationships between classes, UMLit defines a very wide range, such as generalization, achieve, association, aggregation, composition, dependency and the like.

UMLIn the Internet company's project development, usefulness may not be large. In order to document the software design software design or ease of discussion, in most cases, not so readily draw a sketch specification, can convey the idea enough to facilitate communication, and in full accordance with UMLspecifications to standardize the sketch, the price paid is not worth it of.

RECAP

1. What is object-oriented programming?

Object-oriented programming is a programming paradigm or programming style. It is a generic object as tissue or a basic unit of code, and encapsulation, abstraction, inheritance, polymorphism four properties, as the cornerstone of code design and implementation.

2. What is object-oriented programming language?

Support object oriented programming language grammar classes or objects mechanism, and a ready mechanism syntax, can easily realize the four characteristics of object-oriented programming (encapsulation, abstraction, inheritance, polymorphism) programming language.

3. How to determine whether a programming language is object-oriented programming language?

If you follow a strict definition, the need to support existing grammar classes, objects, called the four properties to object-oriented programming language. If you relax the requirements, so long as a programming language support classes, objects grammar mechanism that basically you can say that this programming language is object-oriented programming language, and not necessarily required to have all four characteristics.

4. What is the relationship between object-oriented programming and the object-oriented programming language?

Object-oriented programming object-oriented programming language commonly used to carry out, however, do not object-oriented programming language, we can still be object-oriented programming. Conversely, even if we use object-oriented programming language, write code that is not necessarily object-oriented programming style, there may be process-oriented programming style.

5. What is the object-oriented analysis and object-oriented design?

Simply speaking, object-oriented analysis is to figure out what to do, object-oriented design is to figure out how to do it. The final output stage are two classes of design, including the dismantling program is for which classes, each class has attributes which methods, how the interaction between classes and so on.

Reference: Theory one: when talking about object-oriented, we in the end talking about?

This article from the blog article multiple platforms OpenWrite release!
For more information, please click on my blog Mu Chen

Guess you like

Origin www.cnblogs.com/muchen-li/p/11960317.html