comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria (Jon S Anthony)
Subject: Re: Ada95 OOP Questions
Date: 1996/08/14
Date: 1996-08-14T00:00:00+00:00	[thread overview]
Message-ID: <JSA.96Aug13221742@alexandria> (raw)
In-Reply-To: 4tf3l4$4hu@masala.cc.uh.edu


In article <dahgq78i0z.fsf@explorer2.clark.net> ecn@explorer2.clark.net (Eric C. Newton) writes:

> When I originally read about Ada 95's support for polymorphism, I
> thought that it *must* support multiple dispatch arguments.  That is,
> if you can make any argument the "dispatcher", why not make more than
> one argument the dispatcher (as in CLOS, or Cecil)?

Basically, because no one knew what the "right" dispatch policy should
be in such cases and no one had any intention of putting in something
like the MOP.  So, it didn't happen.

> would choose the correct method based on the run-time types of both
> obj1 *and* obj2.

But if there are several to choose from at runtime???


> essential in large systems.  But objects are kinda handy abstractions
> as well.  Relying on packages as the ONLY structuring mechanism makes
> objects-as-abstractions a little more obscure because they don't
> provide any structure by themselves.  
> 
> It's a pretty hard sell to say (pardon the syntax, 8-):
> 
> 	struct Person;
> 	Eat(Person);
> 	Walk(Person);
> 	Talk(Person);
> 
> "That's a person.  It has the features 'Eat, Walk, Talk'."
> 
> Vs.
> 	class Person
> 	{
> 		Eat();
> 	 	Walk();
> 		Talk();
> 	};
> 

I see no reason why _passive_ entities (the so called objects for
either of the above) should look like they are acting or being
commanded to act.  If you want that then use an activity which in Ada
would be modeled by a task:

    task type Person is
	entry Wake_Up;
	entry Mow_The_Lawn;
	...
    end Person;

    Joe : Person;

    Joe.Wake_Up; -- Joe now independently goes about eating, walking, talking
    ...
    Joe.Mow_The_Lawn; -- Quit stalling and cut the grass...


>    package Matrixes is

Shrug.  And?


> I keep trying to see packages like I see objects and it just doesn't
> get any easier.

That's because they aren't objects/classes.  They are orthogonal constructs.
Classes are classes (T'Class, e.g.), objects are objects ( Obj : T, e.g.)

> Namespaces are good.  Objects are good.  Yes, Ada 95
> has both, but it is pretty good at hiding the objects.

Huh?  An object is quite explicit and obvious:

    X : T;  -- X is an object for any type T.  Pretty clear and obvious.

> could really use the kind of tools available in Ada.  I just don't
> find myself wishing I could make a procedure dispatch on a type by
> adding a keyword.

The use of "tagged" is indeed controversial...


/Jon
-- 
Jon Anthony
Organon Motives, Inc.
1 Williston Road, Suite 4
Belmont, MA 02178

617.484.3383
jsa@organon.com





  parent reply	other threads:[~1996-08-14  0:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-28  0:00 Ada95 OOP Questions Spasmo
1996-07-28  0:00 ` David C. Hoos, Sr.
1996-07-28  0:00   ` Spasmo
1996-07-28  0:00 ` Andre Spiegel
1996-07-28  0:00   ` Spasmo
1996-07-29  0:00     ` Thomas Kendelbacher
1996-07-31  0:00       ` Spasmo
1996-08-01  0:00         ` Thomas Kendelbacher
1996-08-02  0:00         ` Gene Ouye
1996-08-01  0:00       ` Jon S Anthony
1996-07-30  0:00     ` David Wheeler
1996-07-31  0:00       ` Spasmo
1996-07-30  0:00     ` Ken Garlington
1996-08-04  0:00       ` Spasmo
1996-07-29  0:00 ` Andre Spiegel
1996-07-29  0:00   ` Thomas Kendelbacher
1996-08-02  0:00     ` Robert Dewar
1996-08-05  0:00       ` Thomas Kendelbacher
1996-08-06  0:00         ` Robert I. Eachus
1996-08-06  0:00         ` Robert Dewar
1996-08-06  0:00           ` Thomas Kendelbacher
1996-08-06  0:00             ` Robert A Duff
1996-08-07  0:00               ` Robert Dewar
1996-08-08  0:00                 ` Robert A Duff
1996-08-09  0:00                   ` Robert Dewar
1996-08-12  0:00             ` Robert I. Eachus
1996-08-08  0:00           ` Theodore E. Dennison
1996-08-09  0:00             ` Robert Dewar
1996-08-12  0:00             ` Joel VanLaven
1996-08-10  0:00         ` Chris Morgan
1996-07-29  0:00   ` David Wheeler
1996-07-30  0:00     ` Spasmo
1996-07-30  0:00     ` Spasmo
1996-07-30  0:00 ` Andre Spiegel
1996-07-30  0:00 ` Robert I. Eachus
1996-07-30  0:00 ` Andre Spiegel
1996-08-01  0:00 ` Jon S Anthony
1996-08-13  0:00 ` Eric C. Newton
1996-08-14  0:00 ` Eric C. Newton
1996-08-14  0:00 ` Jon S Anthony [this message]
1996-08-14  0:00 ` Ken Garlington
1996-08-21  0:00 ` Jon S Anthony
  -- strict thread matches above, loose matches on Subject: below --
1996-08-08  0:00 W. Wesley Groleau (Wes)
1996-08-20  0:00 Farshad Nayeri
1996-08-21  0:00 ` Jon S Anthony
1996-08-20  0:00 Farshad Nayeri
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox