Op 23-5-2013 9:27, Alexander Broekhuis schreef:
Hi all,
I don't have any objections to this.
I also don't see a cleaner solution without resolving to structs with
functions pointers or struct inheritance. struct inheritance you already
mentioned and for structs with functions pointers will make thinks - in my
opinion - also unclear.
I'll update the bundle code to check if the bundle is the framework or not,
and forward the call accordingly.
Alexander, as soon as things get more complicated and polymorphism is
required again the struct with function
pointers is preferred according to me. The readability is still
acceptable. It is used all over the Linux kernel.
A second followup question: Felix uses something they call systembundle
activators [1], they provide a rather clean way of embedding the framework.
Is this something we would like to have in Celix?
Without systembundle activators, the non-OSGi application has to use the
frameworkbundle to retrieve a BundleContext and work with it. This works
without a problem, but from a code point of view it can become messy.
Having systembundle activators makes this cleaner, since the framework
takes care of calling the activators. This makes it possible to have a bit
more separated implementation for the non-OSGi app.
What do you guys think?
[1]:
http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html#ApacheFelixFrameworkLaunchingandEmbedding-embedding
This is a very useful extension for Celix. It can be very useful for a
lot of legacy code.
Greetings Gerrit