You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@polygene.apache.org by "Niclas Hedhman (JIRA)" <ji...@apache.org> on 2017/05/13 10:48:04 UTC

[jira] [Commented] (POLYGENE-119) Investigate if MethodHandles and CallSites can benefit Polygene

    [ https://issues.apache.org/jira/browse/POLYGENE-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16009256#comment-16009256 ] 

Niclas Hedhman commented on POLYGENE-119:
-----------------------------------------

If I understand it correctly, MethodHandles allows one to create a 'pointer' to a "virtual" Method and that Method can be bound to an object in runtime. I think it would even be possible to add methods to existing objects, and that is in itself a pretty cool idea, coming back to the original Qi4j observation, that Object Oriented Programming should start with an object to which behavior (methods) are added, instead of starting with the methods and deriving an object.

That said, until we have ambition of allowing type changes in runtime, the other possible use would be to build the invocation stack using Method Handles, BUT since we mix Generic and Typed methods in the invocation stack, I don't think that the solution would end up any more elegant than the current one, nor significantly faster, and with the risk of not making it work... So I don't think it should be attempted.

> Investigate if MethodHandles and CallSites can benefit Polygene
> ---------------------------------------------------------------
>
>                 Key: POLYGENE-119
>                 URL: https://issues.apache.org/jira/browse/POLYGENE-119
>             Project: Polygene
>          Issue Type: Task
>            Reporter: Niclas Hedhman
>
> The introduction of invokedynamic at JVM level, also introduced support in the JDK to leverage this.
> We should try to figure out if Reflection and Byte Code generation is still the best option for Polygene. Perhaps these new features are more suitable.
> First task is to find a comprehensive explanation of what these things are, as the Javadocs are incredibly hard to understand, as I think I am lacking some bigger picture explanation.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)