Specifically, programming without inheritance is distinctly not object-oriented; we call it programming with abstract data types.

I found this great line from Grady Booch's "Object-Oriented Analysis and Design With Applications" book. So in order for a program to be an OO one, are inheritance, abstraction, encapsulation, and polymorphism(?) must-to-be things?

Could anybody please explain me?


5 Answers 5


Abstraction and Encapsulation are really the only things required for something to be object- oriented.

Inheritance and polymorphism are strategies to take advantage of NOT "reinventing the wheel" which is a benefit to using OO designs.

The base idea behind OO design is to get a large amount of programmers to work together on project X without incurring massive communication overhead, and breaking a project down into objects with defined communication between them is an elegant solution.


Programming with abstract data types means that when you write:

struct A { int i; float k; };

You can use A a; as abstraction of some bits like [00000000][00000000] (with proper number of bits).

Inheritance adds the following feature:

class A { public: virtual void f()=0; };
class B1 : public A { public: void f() { ... } int a; int b; };
class B2 : public A { public: void f() { ... } int i; float k; };
void algo(A &a) { a.f(); a.f(); }
int main() { B1 b; algo(b); B2 b2; algo(b2); }

i.e. When there are several classes like B1,B2,B3 the algorithms like algo() can work with all of them, even if the format of the bits is changing between B1 and B2, like the { int a; int b; } is different from { int i; float k; }. Only f() needs to be rewritten, not the whole algo().


Quick Short Answer

The answer is that is very subjective to the Software Analyst or Software Modeler.

Extended Boring Answer

There are several concepts that related or part of the Object Oriented Paradigm. You already mention most of them.

For example, one concept you didn't mention, is message-passing, that is missing in most current O.O. programming languages, and was available, together with encapsulation and inheritance in the early O.O. programming languages ("Simula").

I worked sometimes with several variants or "idioms" of Object Oriented Pascal, that had several of those features, and there was a variant that allowed to use "messages", as part of the programming language (keyword "message"), similar to "try catch" exceptions, but, without interrupting execution.

While, other variants, and other programming languages provided as optional libraries (functions not keywords).


You may find that sometimes a programming language may skip some of them, and still be considered by some people O.O., while other not. Its very subjective.

Are you asking for plain intellectual curiosity ?

Do you wonder if the programming language you are using, is fully O.O. ?

Are you working with a collegue / university homework custom O.O. programming language ?

Are you working with a hobbyst, pet project, custom O.O. programming language ?

These questions, is my own curiosity, but, also to know how to make my answer more clear ;-)

There are some programming language & programming paradigms comparison courses at collegues and universities, that deal with this subject.


  • i am doing my final-semester-project :) yes, the thing is conceptual and it seems no language is fully OO !
    – prakashb
    Commented Jan 11, 2012 at 11:21

Useful quotes from the C++ Faq Lite (don't be annoyed by its relation with C++, the concepts are the same in any OOP language):

"Inheritance is what separates abstract data type (ADT) programming from OO programming."

"Programming with classes but without dynamic binding is called object based, but not object oriented." Note that dynamic binding is another term for polymorphism. Also AFAIK inheritance is necessary to implement polymorphic classes.

So to answer your main question, yes, all the things that you are mentioning are "a must" for writing good OOP code.


You could model any domain without inheritance. Inheritance helps to sometimes be more clear about classes, but it is not a mandatory thing in object orientation, despite Booch's quote.

  • Modelling a domain and correctly using object-oriented design are not the same. I posit that designing software of any significant size, using OOD, will require inheritance. Commented Jan 10, 2012 at 19:29
  • I agree with the idea that designing software of any significant size, using OO, will requiere inheritance, but the question looks like rethorical, and with that context in mind for me is not mandatory the use of inheritance
    – JuanZe
    Commented Jan 10, 2012 at 20:32
  • 1
    @SnOrfus object composition will do just as well as inheritance. You don't need inheritance at all.
    – Raynos
    Commented Jan 10, 2012 at 22:53
  • @Raynos: I disagree. Without IEnumerable<>, and the collection classes that implement it, for example, things like LINQ wouldn't be possible - or at best, intractable. The old saying favour composition over inheritance isn't, use composition isntead of inheritance. Commented Jan 24, 2012 at 4:48
  • @SnOrfus depends how composition is implemented. In a dynamic language where you can mix objects into other objects at run-time, composition will just work.
    – Raynos
    Commented Jan 24, 2012 at 10:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.