Skip to content

Creating Custom Diffing Strategies

Egil Hansen edited this page Dec 27, 2019 · 10 revisions

The built-in options/strategies covers a lot of ground and will be enough for many scenarios. However, the diffing engine is pluggable with new strategies to enable custom scenarios. This page show you have to create your own.

To learn when and how the different types of strategies are used, see the Difference Engine Internals page.

Contents:

Understanding the strategy pipeline

The library comes with a single implementation of the IDiffingStrategy interface: DiffingStrategyPipeline.

The strategy pipeline type allows us to register filters, matchers, and comparers that it will call, one at the time, when its Filter, Match, and Compare methods are called by the diffing engine.

When you register strategies, you have to decide what its category is, i.e. if it is a general or _specialized strategy. This affects the order which the pipeline invokes the strategies in. The invocation rules are as follows:

  1. Strategies within the same category

Creating filters strategies

Filter strategy are used during the filtering phase where nodes and attributes are either included or excluded from the comparison.

Creating matching strategies

Creating comparer strategies

Creating strategy libraries/collections

Clone this wiki locally