In a past question I asked how to design a system where:
- A class contains one or more optional methods.
- Optional methods are implemented by plugins that may or not may be present at compile-time.
- If a user invokes a method whose associated plugin is not present at compile-time, they will get a compile-time error.
I provided one possible solution that works in Java 8.
Unfortunately, this solution depends on the use of split packages (two modules exporting the same package) which are disallowed by the Java 9 Module System.
How can this be implemented in Java 9?
Aucun commentaire:
Enregistrer un commentaire