I'd do this by having 'converter' bundles/plugins.
Your data structure reader/manager gets injected with these converters
and invokes the appropriate one(s) after reading a data structure.
This ofcourse requires the version to be stored with the data.
You can even use chains of converters when a converter declares it
'from->to' conversion.
I've done this before for ASML, for XML documents, but the process is
completely analogous.
On 12/08/15 08:50, Frank Langel wrote:
Hello,
Allow a question
Use Case : Data structure evolution
* application evolves, class A evolves from 1.0.0 to 2.0.0
* Need to do an update and retrieve all data by mapping from A(1.0.0)
—> A(2.0.0)
How do I solve this use case
* Does OSGI, perhaps in its latest version, allow for it ?
* I understand that in previous versions, it wasn’t supported
http://stackoverflow.com/questions/18722932/can-an-osgi-bundle-or-package-depend-on-multiple-versions-of-another-bundle-or-p
Current solution
I could use a canonical model A(1.0.0) —> C — > A(2.0.0) , where I would
import A1.0.0 in Bundle b1, and A2.0.0 in Bundle b2, and C into B1 and
b2, and then map A1.0.0 -> C and C —> A2.0.0, but I was wondering if
there is an easier way and allow a point to point mapping without using
the canonical class.
I don’t think there is anything wrong with my current solution, but
perhaps there is some functionality in the latest OSGI version that
simplifies this?
Thanks a lot
Frank
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
--
Ferry Huberts
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev