Details:
- Contains the shared, concrete code
- Defines the abstract points of entry
- The concrete code is the most flexible part of the whole API
- The points of entry are clearly defined and have encapsulated purpose
Details:
- A contract with the outside world that is promised not to change
- Is the most rigid part of the API and should be carefully designed
- Should have limited scope to the framework, focusing instead on equipping the points of entry
Details:
- Business code which focuses on its domain
- Uses the interface to ensure compatibility with the framework
- Can contain as much complexity as needed, but should avoid overlap with the framework — "stay in your lane, bro"
Final Notes
- The framework can have multiple points of entry and therefore interfaces
- If you anticipate extending the interface, provide subclasses or traits to polyfill extensions
- View the framework as flexible and the interface as rigid
Made with Slides.com