Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Model version compatibility with serialized data
Model version compatibility with serialized data [message #1230080] Fri, 10 January 2014 23:47 Go to next message
Roza Ghamari is currently offline Roza GhamariFriend
Messages: 82
Registered: January 2013
Member
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).
Re: Model version compatibility with serialized data [message #1230174 is a reply to message #1230080] Sat, 11 January 2014 06:53 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Previous Topic:DynamicEObjectImpl instead of EObject?
Next Topic:New Ecore Tools
Goto Forum:
  


Current Time: Tue Sep 24 13:21:24 GMT 2024

Powered by FUDForum. Page generated in 0.04356 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top