-
-
Notifications
You must be signed in to change notification settings - Fork 7
Creating Custom Diffing Strategies
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.
- Understanding the strategy pipeline
- Creating filters strategies
- Creating matching strategies
- Creating comparer strategies
- Creating strategy libraries/collections
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:
- Strategies within the same category
Filter strategy are used during the filtering phase where nodes and attributes are either included or excluded from the comparison.