Skip to content

Page logic conventions

Greg Bowler edited this page May 11, 2026 · 2 revisions

This page captures the naming and structural rules that make page logic predictable.

Naming conventions

Page logic filenames should map clearly to page view filenames. Function names should reflect their role:

  • go for the normal page handler
  • go_before and go_after for the surrounding hooks
  • do_* for named actions

Action names should stay explicit and readable. The function name is part of the request flow, so it should be easy to connect it back to the form or button that triggered it.

Structural conventions

Keep page logic thin. Separate orchestration from business rules. Bind output late in the request flow once the data has been loaded and shaped.

If a page needs more local structure, the logic can optionally be wrapped in its own class, but the same underlying rules still apply: clear entry points, small handlers, and minimal hidden behaviour.

Hypermedia

Hypermedia here simply means HTML over HTTP. When the page uses explicit actions, deliberate redirects, and clear URL-based state, the behavioural flow stays much easier to trace.

That is also why richer browser behaviour can be added later through fluid user experience without changing the core request logic into something unrecognisable.


Move on to the view and binding reference page next.

Clone this wiki locally