TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Making Java fully dynamic via invokedynamic and dynamic class creation

2 点作者 nerds-central大约 14 年前
The op-code thing is a means to an end. The key of the article is how to use this technique to get at the new invokedynamic op-code and use the dynamic language features that provides from Java. Java does not support invokedynamic in syntax, so there are a few hoops to jump through to get to it. One can create a class which has an invokedynamic call site in it. Then link to that class. However, that is not very flexible. So using dynamic class loading from op-codes to create a new class site and then using that from Java (by casting to a know interface) makes a very clean pattern for Java its self to make use of invokedynamic.

1 comment

nerds-central大约 14 年前
I am personally convinced that invokedynamic (the new BA op-code for Java 7) is not just for dynamic language support. Patterns like the one in this post _will_ let people develop dynamic approaches to Java. This will effect aspect oriented programming, all reflection based system and so on. I can see applications in server environments where objects/beans etc can use invokedynamic to tight bind initially loosely associated business logic.<p>In short - I believe invokedynamic is a game changer for Java and everything that interoprates with or competes with Java.