apex-enterprise-patterns / at4dx

Advanced Techniques for Salesforce DX Adoption Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extensible Selector

stohn777 opened this issue · comments

Reference

Use Case

In order to properly extend a class, the extension by default should fully represent the super, before any extending changes, per Liskov's Substitution Principle - the L in SOLID.

The paramount method to override is selectInjection, however enabling engineers to override other canonical functionality as needed is desirable, especially since virtualizing the other methods is backwards compatible and does not change functionality -- only freeing engineers to make changes if needed.

Proposed Solution

Virtualize all public or protected methods, enabling engineers to override specific methods as needed for overriding purposes.

image

Pull Request #78