We are working on the proof of concept. Our idea is based on creating a new directory where extension module’s jar will be stored. The directory path will be defined in base module. It will be possible to add this jars manually or through gradle task. Path to base module will be indicated in settings.gradle in extension module.
--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.
To post to this group, send email to openlm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/57864809.1090309%40soldevelo.com.
example.OrderQuantity = org.openlmis.example-extension.AMCOrderQuantity
Hi everyone,
Josh, thank you for your opinion.
Darius, you are right - it is important to provide possibility to mix and match extensions.
We think that the decision about which extensions should be activated can be made by implementators by configuration file.
Small example of how it could look like:
<extensions>
<extension>
<name>AMCOrderQuantity</name>
<point>org.openlmis.example.OrderQuantity</point>
<class>org.openlmis.example-extension.AMCOrderQuantity</class>
</extension>
</extensions>
Then, we see two soulutions how to activate the right extensions defined in this configuration file.
First of them is to write our own Manager (ex. ExtensionsManager) that will have getImplementation method that will return implementation based on configuration file.
This manager will be used to retrieve beans instead of @Autowired annotation.
So if the given extension point has an extension defined in this file, our Manager will return implementation defined in extension module. If not, he will return the default implemetation.
To know which implementation is default, we can create our own @DefaultImplementation annotation.
The second solution is to write class implementing FactoryBean to create custom bean factory.
Overriding getObject() method would allow us to choose which bean will be returned if there is more than one implementation of given extension point.
It will work similar to the first solution, by reading configuration file bean factory will decide which object should be returned. Also, @DefaultImplementation annotation would be useful here.
We will be glad to hear your opinions, and if you have any questions we will be happy to answer them.
When one of the solutions will be chosen, we can start to work on example implementation.
Best regards,
Weronika
On Wednesday, 13 July 2016 23:31:27 UTC+2, djazayer wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/0de4bda4-8f42-409e-be24-a6e675258a76%40googlegroups.com.