Re: OO Design induces an existential crisis




"AndyW" <foo_@xxxxxxxxxxxxxxxx> wrote in message
news:ek5oe15s2vsgk34lci3du8pi13sphehhl7@xxxxxxxxxx

> I think you completely missed the point of the thread. You give the
> impression that you have a fixation on containers in that they are
> neither objects or servces but something completely different outside
> the realms of OO.
>
> I think the answer can be found in your focus on data which is
> probably a basic mistake in the OO realm - your so close to the trees
> you cant see the forest.

First, Andy, I do not have a fixation on containers. It is simply a
well-known,
and widely accepted notion within the world of object technology. I am
surprised
you don't know that. Please look up the phrase "container
class" using a web search utility and see if you can come to some
deeper understanding of what that means.

Let me try again. We have many categories of classes in object technology.
One of those categories is the container class. There are certainly others.

Here is a specification for a container class, in pseudocode,

class Stack
private:
Top : Integer := 0;
Data : array(1..100) of Integer;
public:
method Push(Data : in Integer);
method Pop (Data : out Integer);
method Count return Integer;
end Stack;

We can create instances of class Stack. These instances can also be
called objects of class Stack. A Stack contains elements of some type.
In this example, it the stack contains elements of type Integer. The Stack
object knows its own state, i.e., how many elements it contains. A client
of this container object can detemine the number of elements by calling
the Count method.

I realize I have oversimplified the example by using an array instead of
dynamically using a pointer to a top of stack. This would not be the
more appropriate design for most situations, but the array version
demonstrates the basic principle.

An object of class Stack knows its own state since that is preserved in
the Top attribute. The services for this class are two state modifiers,
Push and Pop, as well as one state reporting method, Count. This is
a passive class since it needs to be called by other classes before it
can do any work. In this sense, it is certainly a service class. However,
in the standard language of object technology, a language you should
try to learn, it is also a container class.

I am not sure why this is so difficult for you to grasp.

As a point of information, I frequently teach object technology along
with a wide range of other software engineering topics at the graduate
school level and seldom have this much difficulty getting such a simple
concept across to my students.

Until you confirm that you do understand the notion of container classes,
we can have no more discussion. Once you do understand it, I will
be happy to continue our conversation. That is, I will read your responses
to this message, but I will not comment until one of those responses shows
some understanding of the subject matter at hand.

Regards,

Richard Riehle



.



Relevant Pages

  • Re: STL stack/deque
    ... >> What is the basic operation on a stack? ... >> may require expansion of the container. ... the default container that stack is using. ... As for the 500-gallon gas tank analogy: To me that's like using a ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Lets put this to rest
    ... The above is consistent with a stack; ... it leaves out the FIFO nature of a stack. ... It's a container with order applied. ... the actual policy can be left to design when that particular business ...
    (comp.object)
  • Re: stack display
    ... >>I want to display a stack but keep the elements in the stack as they were. ... > contains a protected member 'Container c', where Container is the type of ... > Bart v Ingen Schenau ... destroy the copy, leaving the original untouched. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: display stack
    ... >> Container. ... Perhaps you could derive your own stack class from ... > now when I read your posting I looked it up in the Holy Standard, ... > struct Hack: public Stack ...
    (comp.lang.cpp)
  • Re: OO Design induces an existential crisis
    ... The object you were describing is a container. ... point in creating a software object. ... change, and how to design for change, is a fundamental problem ... for novices in object technology. ...
    (comp.object)