Add support for static/linked libraries bundles #94
Labels
component/framework
Categorizes an issue or PR relevant to the framework.
kind/improvement
Categorizes issue or PR as related to improvements.
Milestone
Support for Static Bundle Libraries
The goal of this ticket is to introduce support for static bundle libraries in Apache Celix. These static libraries, which may or may not include shared libraries, will be linked with an executable and function as bundles for the Apache Celix Framework.
Advantages
Simplified Deployment: By allowing the creation of single executable files that can encompass all necessary dependencies, the deployment process can become more straightforward.
Less Configuration: Leveraging static libraries reduces the need for additional configuration (bundles dependencies, compiler defines for bundle files, etc), particularly during testing. It could be possible that only a linking to a (static) bundle library is needed.
Standard Build Tool Usage: Bundles as static libraries can use the default build tooling facilities (linking, installation, and other build-related tasks).
Rust alignment: Using static libraries as bundle is more aligned with development concept used in languages like Rust.
Challenges
Maintaining the Open-Close Principle: A challenge is ensuring that static bundle libraries can be integrated without violating the Open-Close Principle. Ideally, developers should be able to include static bundle libraries with minimal changes to the source code. One potential solution to explore is using the compiler attribute
__attribute__((constructor))
to handle initialization.Handling Resource Files: Static bundle libraries should be capable of containing resource files. A possible approach to address this is by "linking" binary zip files into the static bundle library. This method allows resource files to be embedded within the bundle.
Multiple Framework Instances: If the concept of
__attribute__((constructor))
is adopted, this will have impact when multiple framework instances are created. Bundles could be added to all instances by default or only the first instance, etc.Bundle Activator Setup: The current setup for bundle activators relies on predefined symbol names, which does not function with static bundles. Although not a major issue, it could complicate the creation of two versions of a bundle, one as a static bundle and the other as a zip bundle.
Default Delivered Bundle: A final decision must be made regarding the default delivered bundle type for Apache Celix bundles (static bundle, zip bundle or both)
Links
https://docs.cppmicroservices.org/en/stable/framework/doc/static_bundles.html
The text was updated successfully, but these errors were encountered: