Open gbonnefille opened 7 years ago
There is not unfortunately.
The whole init approach is something we are going to look at replacing in the next version of the Java MAL API as it is quite inflexible (as you have found).
IMO, the idea of a whole init is a good idea, but it reclaims the opposite function.
I can easily imagine a project involving the Java MAL API in an OSGi context. In such context, the project will certainly want to create an Activator
registering and unregistering the types embedded in a module when the bundle is loaded and unloaded. By this way, the platform is ready to use immediately, without any action of the end user.
Yes, true, but I am concerned about multiple registrations and deregistrations.
I have a feeling there is a better approach to this problem that avoids situations like this.
Oh... OK. Nice to read you have other solutions.
Well I wouldn't go as far as saying we have a solution! But we do feel your pain and we have aims to fix it in a future release. See
The generated helpers (i.e.
MALHelper
) offer ainit
function to register all data types into the ElementFactory. But when called twice, an exception occurs.Is there a function providing the opposite behavior of
init
?