Dynamic (i.e responding to methodNotFound) classes in Java
Behrang Saeedzadeh
behrangsa at gmail.com
Fri Jun 14 04:16:41 UTC 2013
Thanks for the clarification John. I also believe this was inconsistent
with Java's philosophy, but I was just wondering what happened to that
stuff.
Cheers,
Behrang Saeedzadeh
http://www.behrang.org
On Fri, Jun 14, 2013 at 12:05 PM, John Rose <john.r.rose at oracle.com> wrote:
> On Jun 13, 2013, at 6:26 PM, Behrang Saeedzadeh <behrangsa at gmail.com>
> wrote:
>
> > Hi,
> >
> > A couple of years ago I downloaded an experimental build of JDK with
> > invokedynamic support and it contained a class (DynamicObject?) that any
> > method could be invoked on its subclasses without any compile time
> errors.
> >
> > Does this class still exist? I can't find it anymore in the API docs.
>
> No. There were partial prototypes in this direction as part of JSR 292,
> but they were abandoned in 2009. Here is a proposal from that time frame:
> https://wiki.openjdk.java.net/display/mlvm/DynamicJava
>
> Nothing like this exists or was built in any usable way.
>
> Untyped or "duck typed" invocation of objects can be done easily enough
> with third-party libraries, or with reflection, or using a dynamic language
> like JavaScript or JRuby or ${your_favorite_jvm_language}.
>
> In my opinion, Java the language is unlikely to support such a thing in
> the near future, since there are many reasonable alternatives.
>
> — John
More information about the discuss
mailing list