|
Re: Model version compatibility with serialized data [message #1230174 is a reply to message #1230080] |
Sat, 11 January 2014 06:53 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Roza,
One approach is that the nsURI itself changes when you make incompatible
version changes, and then you can detect the version from the nsURI.
You might use content type parser registrations in this case, rather
than simply file extension registration; with that approach you can
register a resource factory that can try to load the old serialization
using a dynamic version of the old model and transform it into the new
model. The UML2 project takes that approach. You might also model
this version information directly on the root object of the resource and
use an option like
org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE to
read as much of the model as possible.
On 11/01/2014 12:47 AM, Roza Ghamari wrote:
> We are using EMF and XMI serialization for our RCP based application
> where different plugins will have their own models and they will all
> store the data in xmi. What I am wondering is how to be able to check
> if a selected xmi file can be loaded to the version of model that is
> installed and running on the RCP? Basically if the xmi file is written
> on an RCP with the model version 1.x.x and it is unloaded on another
> RCP with model version 2.x.x, how this can be catched that the data is
> not compatible with the version of model? (Assuming v2 is not
> compatible with v1).
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04356 seconds