I'm looking at the code right now, and I'm making some
refactorings to use components as BaselineValidators and let user
choose the component he wants (similar to
BuildTimestampProviders).
I have a question on this topic: Is it safe that having
BaselineMode.disable <=> BaselineReplace.none <=> No
Baseline validator?
I've thought of the following related refactorings:
Iteration #1, no change for users:
* Make BaselineValidator an interface, rename current
BaselineValidator to "BaselineVersionValidator"
* Use components with Role BaselineValidator. Current
implementation would have a hint such as "exact-version".
* Introduce a "baselineStrategy" property to select the component
to use for baseline. Default value would be "exact-version" to not
change current behavior.
* Implement a NoBaselineValidator which does nothing
(baselineStrategy="none"), independently of baselineMode and
baselineReplace.
Iteration #2: Make it useful without breaking anything
* Implement a compatible-version-with-same-content strategy,
comparing content of bundles with same x.y.z (ignoring qualifier)
and replace by baseline when there is no change worth producing a
new bundle.
At the end of this iteration, we should be able to consume
"compatible" bundles from baseline just by setting
baselineStrategy="compatible-version-with-same-content"
Iteration #3: Make it shine, but this would contain breaking
change:
* Move the support of the BaselineMode and BaselineReplace to an
abstract class, since it seems like they'll be handled the same
way by various BaselineValidator. It appears that this abstract
class would probably consume some "deltas" provided by
implementations.
* Make default behavior being using baselineStrategy="none" (would
force current users to set baselineStrategy="exact-version")
* Remove BaselineMode.disable and BaselineReplace.none in favor of
using no baseline (baselineStrategy=none will select a baseline
validator that does nothing).
Does it make sense? Does this looks like a valid path?
Cheers,
_______________________________________________
tycho-dev mailing list
tycho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-dev
|