I have "utilities" which can be used with objects. Per your example, if object(wall) and object(chair) both share the attribute(color) then they both can utilize function(paint). The only prerequisite would that they are paintable.
I have "utilities" which can be used with objects. Per your example, if object(wall) and object(chair) both share the attribute(color) then they both can utilize function(paint). The only prerequisite would that they are paintable.
These things are much easier to reason about and to compose than classes with inheritance.
For example, it is easy to solve Expression Problem [1] with interfaces and properties and it is hard to solve it with only classes and inheritance.
Fair. Personally, that looks like an argument for objects rather than against.
Do these concepts oppose or complement OOP? Is inheritance somehow a hidden requirement?
And as you can see in the discussion arising, even this simple example is becoming a complex modelling problem in OOP.