The differences between ComProgramming?
and standard ObjectOrientedProgramming
, as quoted from the foreword by CharlieKindel?
= Polymorphism + (Some) Late Binding + (Some) Encapsulation + Inheritance
= Polymorphism + (Really) Late Binding + (Real, Enforced) Encapsulation + Interface Inheritance + Binary Reuse
Implementation Inheritance is not considered Component Oriented Programming because the idea behind component programming is limited dependence, and implementation inheritance is the strongest dependence in programming. See the FragileBaseClassProblem
Do we need yet another term for ComponentBasedDevelopment
Otherwise, I have some problems with both definitions, they are overly simplisitic, and inexact. For example, I once created a specialized Delphi component, by inheriting the TDBLookupCombo implementation and modifying some behaviour, and by that definition I wasn't doing component oriented programming, and if creating components is not component oriented programming, then we really have a problem. -- CostinCozianu
Direct inheritance is against the idea of COP more or less. Inheritance creates a dependency, but components should be relatively independent. If they "inherit", it is through DuckTyping
: they fit a predefined interface.