There are 3 requirements for a language to be object-oriented:
- a language that supports only encapsulation (objects) is not object-oriented, but it is modular
- a language that supports just encapsulation (objects) and message-passing (polymorphism) is not object-oriented, but it is object-based
- a language that supports encapsulation (objects), message-passing (polymorphism), and inheritance (abstraction), is object-oriented
NOTE: Abstraction is a much more general concept; encapsulation et al are kinds of abstraction, just as a subroutine is a kind of abstraction. See Abstraction
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…