[21] in java-interest
Re: Why is Java not more reflective
daemon@ATHENA.MIT.EDU (James B. Gledhill)
Wed Apr 26 16:58:59 1995
Date: Wed, 26 Apr 1995 10:01:25 -0500
From: james.gledhill@wichita.brite.com (James B. Gledhill)
To: java-interest@java.Eng.Sun.COM
> Arthur:
>
> I think you misunderstood me. I would like to implement a method that passes
> *any* message I specify to a set of objects. Suppose I want to send foo to a
> Vector v of objects, then my only choice now is to write:
I agree with Charles. This is something Objective-C has that is very useful.
>
> for (Enumeration e = v.elements; e.hasMoreElements(); )
> e.foo();
>
> over and over again in different places for each different message "foo." I'd
> like to be able to say, e.g.:
>
> v perform: "foo"
>
> but Vector can't implement such a message since there is no way to dispatch
> methods dynamically. This is a pretty common thing to want to do, and I just
> wondered if there was some workaround you guys use in lieu of the above.
Charles is not alone on this. Dispatching methods dynamically is very important.
I would be very interested in getting any pointers (hints) on how this can be
done.
- James Gledhill
----------------------------------------------------------------------
james.gledhill@brite.com Phone: (316) 652-6538
----------------------------------------------------------------------
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com