Skip to content

Class-based OOP

我们已经知道了class-based OOP是OOP的一个流派,本文将对class-based OOP进行详细分析。

维基百科Class-based programming

原文在很多下面这段话我觉得非常具有启发性

Object-oriented programming is more than just classes and objects; it's a whole programming paradigm based around objects (data structures) that contain data fields and methods. It is essential to understand this; using classes to organize a bunch of unrelated methods together is not object orientation.

Junade Ali, Mastering PHP Design Patterns

Class-based OOP的特性

Class-based OOP的特性:

1) Abstraction

在tutorialsteacher Dependency Inversion Principle中有这样的描述:

Abstraction and encapsulation are important principles of object-oriented programming.

2) Inheritance

3) Encapsulation

4) Polymorphism

在维基百科Design Patterns#Introduction, Chapter 1中有这样的描述:

Use of an interface also leads to dynamic binding and polymorphism, which are central features of object-oriented programming.

本段参考的内容有:

Design

参见Theory\Design-pattern\OOP-design-pattern章节。