Difference between revisions of "Interface injection"
(New page: Interface Injection is a feature that allows adding interfaces that have been defined as injectable into any target class that does not already implement that interface.) |
(→Workshop discussions) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Interface Injection is a feature that allows adding interfaces that have been defined as injectable into any target class that does not already implement that interface. | Interface Injection is a feature that allows adding interfaces that have been defined as injectable into any target class that does not already implement that interface. | ||
+ | |||
+ | =="The case for Interface Injection"== | ||
+ | ;Speaker: [http://www.thobe.org/ Tobias Ivarsson] | ||
+ | ;Project: https://github.com/thobe/mlvm (a patchset for the patchset for OpenJDK) | ||
+ | ;Slides: [[Media:inti2011.pdf | The case for Interface Injection]] | ||
+ | |||
+ | ===Abstract=== | ||
+ | It is time to start laying out the features for Java 8. I would like to propose considering interface injection for that feature set. Interface injection is the ability to inject an interface defined as injectable into any class in the JVM. In this talk I will outline the current status of the specification and implementation of interface injection. I will go through the various areas where interface injection is applicable, such as low overhead adapters, traits, and dynamic types. And I will discuss how interface injection relates to other features, such as defender methods and invoke dynamic. | ||
+ | |||
+ | ===Workshop discussions=== | ||
+ | |||
+ | {| style="text-align:center;" | ||
+ | ! | ||
+ | ! <span title="of a method declared in an interface to a class that implements that interface">Add implementation</span> | ||
+ | ! <span title="to a class that doesn't already implement that interface, so that it now implements that interface">Add interface</span> | ||
+ | ! <span title="to an interface">Add method</span> | ||
+ | | ''(<-- hover these titles for description)'' | ||
+ | |- | ||
+ | | Defender methods | ||
+ | | X | ||
+ | | | ||
+ | | | ||
+ | | ''add implementations for methods defined in the interface, that the class doesn't implement'' | ||
+ | |- | ||
+ | | Interface adaptation | ||
+ | | | ||
+ | | X | ||
+ | | | ||
+ | | ''Add an interface to a class that doesn't declare that it implements that interface, but implements all methods of the interface'' | ||
+ | |- | ||
+ | | Interface injection | ||
+ | | X | ||
+ | | X | ||
+ | | | ||
+ | | ''Add an interface to a class that doesn't declare that it implements that interface, also add implementations for the methods of that interface'' | ||
+ | |- | ||
+ | | Implements ''Dynamic'' | ||
+ | | | ||
+ | | | ||
+ | | X | ||
+ | | ''Invoke any method (name+signature) on a class that declares that it implements a special interface'' | ||
+ | |- | ||
+ | | Inject ''Dynamic'' | ||
+ | | X | ||
+ | | X | ||
+ | | X | ||
+ | | ''Invoke any method (name+signature) on any class, by adding a special interface'' | ||
+ | |} |
Latest revision as of 13:55, 20 July 2011
Interface Injection is a feature that allows adding interfaces that have been defined as injectable into any target class that does not already implement that interface.
"The case for Interface Injection"
- Speaker
- Tobias Ivarsson
- Project
- https://github.com/thobe/mlvm (a patchset for the patchset for OpenJDK)
- Slides
- The case for Interface Injection
Abstract
It is time to start laying out the features for Java 8. I would like to propose considering interface injection for that feature set. Interface injection is the ability to inject an interface defined as injectable into any class in the JVM. In this talk I will outline the current status of the specification and implementation of interface injection. I will go through the various areas where interface injection is applicable, such as low overhead adapters, traits, and dynamic types. And I will discuss how interface injection relates to other features, such as defender methods and invoke dynamic.
Workshop discussions
Add implementation | Add interface | Add method | (<-- hover these titles for description) | |
---|---|---|---|---|
Defender methods | X | add implementations for methods defined in the interface, that the class doesn't implement | ||
Interface adaptation | X | Add an interface to a class that doesn't declare that it implements that interface, but implements all methods of the interface | ||
Interface injection | X | X | Add an interface to a class that doesn't declare that it implements that interface, also add implementations for the methods of that interface | |
Implements Dynamic | X | Invoke any method (name+signature) on a class that declares that it implements a special interface | ||
Inject Dynamic | X | X | X | Invoke any method (name+signature) on any class, by adding a special interface |