[All] POC: ObjectFactory: Explicit components registration
⚠️ Proof-of-concept ⚠️
- Task #3770
Main goal is to remove the ObjectFactory singleton (later) and the implicit registration of objects while loading dynamic libraries (plugins)
In this PR, the explicit registration is applied on components of Sofa.Component.StateContainer
The legacy RegisterObject mechanism is preserved and will warn the user at the compilation and at run-time.
EDIT:
- add tests about plugins non-registering/registering implicitly/registering explicitly
- add deprecations/warnings in RequiredPlugin
- add a function registerPlugin in PluginManager. This function is simply an alias for loadPlugin() because loadPlugin() does much more than just loading a plugin by itself. In an eventual future, PluginManager should be refactored in a way that loadPlugin calls registerPlugin()
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if
- it builds with SUCCESS for all platforms on the CI.
- it does not generate new warnings.
- it does not generate new unit test failures.
- it does not generate new scene test failures.
- it does not break API compatibility.
- it is more than 1 week old (or has fast-merge label).
[ci-build][with-all-tests]
[ci-build][with-all-tests][force-full-build]
[ci-build][with-all-tests][force-full-build]
Maybe some ideas here: https://github.com/sofa-framework/sofa/pull/2712
[ci-build][with-all-tests][force-full-build]
[ci-build][with-all-tests][force-full-build]
Closing (postponing), several issues detected in this PR
- PluginManager is not satisfactory
- meta-modules are not well designed so induced too much complexities
[ci-build][with-all-tests]
For @sofa-framework/reviewers : this PR is now ready but it will have a massive impact on all the code base.
Any feedback is more than welcome. A compatibility layer is obviously implemented
We suggest to merge this PR but temporarily de-activating all the warnings (compilation-time and runtime). Another PR will start the cleaning within SOFA and its official plugins. When the main part will be done, warnings will be re-activated so that plugin authors can be informed.
[ci-build][with-all-tests][force-full-build]