Skip to main content

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.

Jump to: navigation, search

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

(New page: = Evolution Specification: Provide a match engine extension mechanism = Current status is '''DRAFT''' == Preamble == It enables to provide his own match engine implementation. * ==...)
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Template:EMF Compare Archive Notice}}
 +
 
= Evolution Specification: Provide a match engine extension mechanism  =
 
= Evolution Specification: Provide a match engine extension mechanism  =
  
Current status is '''DRAFT'''
+
Current status is '''ARCHIVED'''
  
 
== Preamble  ==
 
== Preamble  ==
Line 7: Line 9:
 
It enables to provide his own match engine implementation.
 
It enables to provide his own match engine implementation.
  
*
+
*[https://bugs.eclipse.org/bugs/show_bug.cgi?id=403055 Bug 403055] - Provide a match engine extension mechanism
 
+
*[https://git.eclipse.org/r/#/c/11080/ Review 11080]
  
 
== Introduction ==
 
== 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  ==
 
== Detailed Specification  ==
Line 19: Line 20:
 
We propose to provide a match engine extension mechanism.
 
We propose to provide a match engine extension mechanism.
  
Any extension will be able to contribute a match engine on a subclass of Diff.  
+
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.
 
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.  
 
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.  
Line 28: Line 29:
  
 
=== Metamodel Changes ===
 
=== Metamodel Changes ===
 +
 +
N/A
 +
 +
=== API Changes ===
 +
 +
* Update interfaces:
 +
 +
<source lang="java">
 +
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();
 +
}
 +
  }
 +
}
 +
</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>
  
 
=== User Interface Changes ===
 
=== User Interface Changes ===
 +
 +
N/A
  
 
=== Documentation Changes ===
 
=== Documentation Changes ===
Line 36: Line 93:
 
*New and Noteworthy
 
*New and Noteworthy
 
*Developer Guide
 
*Developer Guide
 
  
 
== Tests and Non-regression strategy ==
 
== 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  ==
 
== Implementation choices and tradeoffs  ==
  
 
N/A
 
N/A
 
[[Category:EMF Compare]]
 

Latest revision as of 12:24, 5 March 2014

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.

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

Back to the top