Stuff Learnin

with...

Nathan Knowler

Stuff Learnin

with...

El hombre en el sombrero

API Architecture

Framework

Concrete

Interface

Framework

Framework

Concrete

Interface

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

Interface

Framework

Concrete

Interface

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

Interface

Framework

Concrete

Interface

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"

API Architecture

Framework

Concrete

Interface

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

Thanks, Friend

All Hands Dev Party (2022-02-11)

By Jason Adams

All Hands Dev Party (2022-02-11)

  • 509