lithium
lithium copied to clipboard
Standalone Strategies
Strategies are a powerful concept which could be shining even more. On the other hand is Adaptable overloaded with functionality (it should only really care about adapters).
Strategies have been invented after Adaptable was already in place. Back then it made sense to combine them as only adapter-based Classes wanted to use Strategies (Cache, Session).
- split strategies from Adaptable
- allow classes to combine adapters and strategies together (might make both Traits to mix them)
- allow classes to use just adapters or strategies
- create a formal concrete Strategy abstract base class, with support for read, write, delete
- all strategies should inherit from that base class
- Instead of providing a general helper method to apply strategies (applyStrategies()) that code will be inlined and code wanting to apply strategies, will so directly. This way we don’t have to find a place for such a general helper method and reduce line count.
Early beginnings/ongoing https://github.com/UnionOfRAD/lithium/tree/future/strategy-class