Most DerivativeInterface implementations share common code(getDerivativeDefinition()
and data (protected $derivatives
).
Refactoring them to an abstract base class would help us remove some duplicated code and reduce the apparent complexity of plugin derivative creators by making them only have to write one method (getDerivativeDefinitions()
).
The already copy/pasted implementations are present in:
- BlockPluginUI
- CustomBlock
- DefaultWizardDeriver
- LanguageBlock
- Layout
- SelectionBase
- SystemMenuBlock
Alternate implementations are present in AggregatorCategoryBlock and AggregatorFeedBlock (more inline code), EntityDerivative (slightly different), and MockLayoutBlockDeriver and MockMenuBlockDeriver (always invoke getDerivativeDefinitions(), do not use $this->derivatives caching).