arcanefoam / ecco

A Feature-Oriented Version Control System
https://llinsbauer.github.io/ecco/
0 stars 0 forks source link

Create a resource reconstructor #3

Closed arcanefoam closed 7 years ago

arcanefoam commented 7 years ago

For the writer and the viewer we need a helper class that can reconstruct an EMF resource given an Ecco tree. Issue #1 depends on this

arcanefoam commented 7 years ago

In order to reconstruct the resource, we need to save information about the metamodel. First, the recosntructor can look for the Epackage (and from it its factory) in the registry. If not there, we could additionally use the schema location information to reload the pacakge. For example, if ecco starts and no resource has been loaded, then the EPackage would not have been loaded.

arcanefoam commented 7 years ago

The reconstructor expects each node to save information about the class of the eobject and the package (the package information specifies if the package is expected to be in the resource set, or if it is a local resouce). On recosntruction the package nsUri will be used to locate the pacakge in the provided resourceSet. If not found, it uses the information about the local path (if available) to load the metamodel into the resource set.