You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently relying on "SPI" provided by ServiceLoader.
The bug #11707 showed us some limitations of this approach in conjunction with Native Image.
Additionally, some of our libraries contain Java code solely to register their SPIs, for example the Microsoft library contains only SPI registrations and no other Java code.
At some point we would like to get a "native" facility giving us ability to implement a similar pattern in pure Enso. We would like to be able to register some types defined in various libraries as "implementations" of a base SPI and then ability for the base type to query a list of all available registrations.
This way we:
no longer need to add a Java library just to register SPI types,
can have more control - can not expose SPIs for libraries that are not loaded within Native Image.
The text was updated successfully, but these errors were encountered:
One other thing that has been discussed lately is being able to discover libraries that are not currently loaded but are available (on user's system or in current edition).
Perhaps this new facility could give us a way to query either currently loaded libraries or additionally also all libraries that are available to be imported. This will allow us to move towards not importing all libraries in the default GUI project but only the basic stuff (Base, Table, Database) and being able to add additional imports on demand. The full ability to do this will require co-ordination between engine, libs and GUI, so it probably requires additional design. But I'm noting this requirement here so that we can take into consideration that listing all 'available' and not necessarily currently loaded implementations of an SPI is one of the things that we may need in the future, so it would be good if this new facility was prepared to handle this.
radeusgd
changed the title
Enso facility for finding implementations of a type across loaded/available libraries
Enso facility for finding implementations of SPI across loaded/available libraries
Nov 29, 2024
We are currently relying on "SPI" provided by
ServiceLoader
.The bug #11707 showed us some limitations of this approach in conjunction with Native Image.
Additionally, some of our libraries contain Java code solely to register their SPIs, for example the
Microsoft
library contains only SPI registrations and no other Java code.At some point we would like to get a "native" facility giving us ability to implement a similar pattern in pure Enso. We would like to be able to register some types defined in various libraries as "implementations" of a base SPI and then ability for the base type to query a list of all available registrations.
This way we:
The text was updated successfully, but these errors were encountered: