Re: Confusion With Inheritance



H. S. Lahman wrote:
Responding to Martin...

Notice that when you described your classes, you described them in
terms of the data that they held, and not in terms of the behavior
that they exhibited. This is the first, and most serious, problem
with your example. Object Oriented Design is a discipline for
partitioning *behavior*, and *incidentally* the data that goes with
that behavior.


We disagree Big Time on this one.

Knowledge and behavior responsibilities have always been given equal stature in OO development. One abstracts the /intrinsic/ properties of problem space /entities/. The proportions of knowledge vs. behavior or their relative importance to the solution is not relevant -- one abstracts and encapsulates the entity's bundle of relevant properties as the object.

Defining objects based primarily around behaviors rather than the whole entity is just a form of procedural functional decomposition. One ends up defining a function library that collects procedures into classes rather than abstracting the problem space. Then when one connects up the class library with messages one has a C or FORTRAN program with strong typing.

I swear every time someone mentions concepts in the "problem space" I go blank. There are no concepts in the problem space other than those we put there and we can reconceptualize as we need to to make software development more effective.


Michael Feathers
www.objectmentor.com


.



Relevant Pages

  • Re: Confusion With Inheritance
    ... The proportions of knowledge vs. behavior or their relative importance to the solution is not relevant -- one abstracts and encapsulates the entity's bundle of relevant properties as the object. ... Defining objects based primarily around behaviors rather than the whole entity is just a form of procedural functional decomposition. ... Pathfinder Solutions -- Put MDA to Work ...
    (comp.object)
  • Re: Confusion With Inheritance
    ... Defining objects based primarily around behaviors rather than the whole entity is just a form of procedural functional decomposition. ... One ends up defining a function library that collects procedures into classes rather than abstracting the problem space. ... There are no concepts in the problem space other than those we put there and we can reconceptualize as we need to to make software development more effective. ...
    (comp.object)
  • Re: Confusion With Inheritance
    ... Defining objects based primarily around behaviors rather than the whole entity is just a form of procedural functional decomposition. ... One ends up defining a function library that collects procedures into classes rather than abstracting the problem space. ... At the OOA level a domain expert who knows nothing about software or the developer's solution should be able to describe what an object is and what its responsibilities are fairly accurately just from the name. ... I have a description of a language interpreter in this blog: http://www.artima.com/weblogs/viewpost.jsp?thread=120750 ...
    (comp.object)