ODMA

Code organization

← Back to concept

Locality follows ownership

Keep a capability's implementation and tests with its owner. Do not extract a function merely because another file is possible. Reuse does not automatically justify moving behavior into utils.

A Vue component may need decomposition when it exceeds roughly 300 lines, combines independent responsibilities or contains behavior with a natural domain owner. Domain logic moves into that domain, not an anonymous generic composable.

domains/business/catalog/
  models.ts
  api/
  ui/
  tests/

This is an ownership example, not a mandatory folder template. Backend modules may keep models, serializers, views, admin and CMS plugins under the same domain. Preserve explicit Django app labels, database identities and public exports during refactoring.