Professional software engineer, musician, gamer, stoic, democratic socialist

  • 1 Post
  • 13 Comments
Joined 2 years ago
cake
Cake day: July 2nd, 2023

help-circle












  • Organizationally, you don’t want your API handler to care about implementation details like database queries. All DB interaction should be abstracted into a separate layer.

    Generally API handlers only care about injecting any “global” dependencies (like a database object), extracting the request payload, and dispatching into some lower-level method.

    None of this requires generic code. It’s just about having a clear separation of concerns, and this can lead to more reusable and testable code.