Re: OO Design induces an existential crisis
- From: <adaworks@xxxxxxxxxxxxx>
- Date: Sun, 31 Jul 2005 02:48:48 GMT
"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
.
- Follow-Ups:
- Re: OO Design induces an existential crisis
- From: Ilja Preuß
- Re: OO Design induces an existential crisis
- References:
- Re: OO Design induces an existential crisis
- From: adaworks
- Re: OO Design induces an existential crisis
- From: AndyW
- Re: OO Design induces an existential crisis
- From: adaworks
- Re: OO Design induces an existential crisis
- From: AndyW
- Re: OO Design induces an existential crisis
- From: adaworks
- Re: OO Design induces an existential crisis
- From: AndyW
- Re: OO Design induces an existential crisis
- Prev by Date: Re: OO Design induces an existential crisis
- Next by Date: Re: OO Design induces an existential crisis
- Previous by thread: Re: OO Design induces an existential crisis
- Next by thread: Re: OO Design induces an existential crisis
- Index(es):
Relevant Pages
|