Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EMF Compare/Specifications/MatchEngineExtension"

(Backward Compatibility and Migration Paths)
(API Changes)
Line 62: Line 62:
 
   }
 
   }
 
}
 
}
 +
</source>
 +
 +
* Add extension point:
 +
<source lang="xml">
 +
<extension-point id="matchEngine" name="Match Engine" schema="schema/matchEngine.exsd"/>
 +
</source>
 +
Example of use:
 +
<source lang="xml">
 +
<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>
 
</source>
 
</source>
  

Revision as of 11:18, 12 March 2013

Evolution Specification: Provide a match engine extension mechanism

Current status is DRAFT

Preamble

It enables to provide his own match engine implementation.

  • Bug 403055 - Provide a match engine extension mechanism

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

Implementation choices and tradeoffs

N/A

Back to the top