vitorsouza/Zanshin — Issue #4: Use EcoreUtil.Copier before replacements
Author: vitorsouza
Created: 2012-02-15 11:30:27+00:00
State: open
Labels: Improvement

`EcoreUtil.Copier` (see http://download.eclipse.org/modeling/emf/emf/javadoc/2.4.3/org/eclipse/emf/ecore/util/EcoreUtil.Copier.html) can be used to create copies of EMF objects, including their references. For example, see `it.unitn.disi.zanshin.simulation.cases.acad.AcadAwReqsMonitor.monitorMethodCall()`, where a copy of the failed `AwReq` is created to replace the failed one.

To improve model replacement in Zanshin, the following could be done:

1. Look for other places in Zanshin where instance replacement is done and use the copier instead of the current solution (e.g. in the Scalable Simulation a copy of the goal model is created manually!);
2. Analyze what the copier does with the references to identify things that are being done again in Zanshin's implementation of requirement replacement (see `it.unitn.disi.zanshin.model.gore.impl.RequirementImpl.replaceWith()` and overridden implementations of this method).