Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EMF Compare/Specifications/MatchEngineExtension
THIS PAGE IS ARCHIVED. IT IS PROBABLY OUTDATED AND WILL NOT BE UPDATED
Evolution Specification: Provide a match engine extension mechanism
Current status is ARCHIVED
Preamble
It enables to provide his own match engine implementation.
- Bug 403055 - Provide a match engine extension mechanism
- Review 11080
Introduction
The actual mechanism to provide his own match engine is not very flxible. An extension point mechanism will be useful to alllow users to provide their own match engines.
Detailed Specification
We propose to provide a match engine extension mechanism.
Any extension will be able to contribute a match engine. The match engine registry will be queried each time a match engine will about to be performed. A match engine contribution will provide its own predicate that will need to be verified before it is considered to be a valid candidate to execute the comparison. It will also have a ranking in order to choose over multiple possible match engine.
Standard match engine operations will be rewritten with the lowest ranking in order to be overrideable.
Backward Compatibility and Migration Paths
Metamodel Changes
N/A
API Changes
- Update interfaces:
public interface IMatchEngine { Comparison match(IComparisonScope scope, Monitor monitor); interface Factory { IMatchEngine getMatchEngine(); int getRanking(); void setRanking(int parseInt); boolean isMatchEngineFactoryFor(IComparisonScope scope); interface Registry { IMatchEngine.Factory getHighestRankingMatchEngineFactory(IComparisonScope scope); Collection<IMatchEngine.Factory> getMatchEngineFactories(IComparisonScope scope); IMatchEngine.Factory add(IMatchEngine.Factory matchEngineFactory); IMatchEngine.Factory remove(String className); void clear(); } } }
- Add extension point:
<extension-point id="matchEngine" name="Match Engine" schema="schema/matchEngine.exsd"/>
Example of use:
<extension point="org.eclipse.emf.compare.rcp.match"> <extension point="org.eclipse.emf.compare.rcp.matchEngine"> <engineFactory class="org.eclipse.emf.compare.match.impl.MatchEngineFactoryImpl" ranking="10"> </engineFactory> </extension> </extension>
User Interface Changes
N/A
Documentation Changes
This documentation will have to be updated:
- New and Noteworthy
- Developer Guide
Tests and Non-regression strategy
JUnit tests: MatchEngineFactoryRegistryTest.java in o.e.e.c.tests.
Manual tests: Detection of the extension launching a match engine action.
Implementation choices and tradeoffs
N/A