BotNetwork

Hexagonal layout for bot codebases

isolate platform adapters from domain logic for testability

Guide1 min readUpdated

Why it matters

Isolate platform adapters from domain logic for testability.

Practical steps

  1. Draw the boundary for arch hexagonal bots: what belongs in the bot process vs a worker.
  2. Implement isolate platform adapters from domain logic for testability behind a narrow interface so platforms can share it.
  3. Make arch hexagonal bots idempotent at the message/update id layer.
  4. Add contract tests between the adapter and the core for arch hexagonal bots.
  5. Document failure modes and ownership of arch hexagonal bots for on-call.

Watch out for

  • Copy-pasting outdated snippets for arch hexagonal bots without re-reading current official docs.
  • Shipping arch hexagonal bots to production without a staging rehearsal and a documented rollback.

Related comparisons and tools