Briefle
LearnGlossaryPricing

Briefle words · Code & architecture

Domain type

A type named after a real concept in the business, which keeps related data and rules together.

Say it to an AI

TypeScript money.ts module in src/cart: a cohesive module built around a Money domain type ({ cents, currency }) with formatMoney, addMoney and applyDiscount. Keep unrelated helpers like slugify or sleep out of it; no generic utils file.

How an expert would brief the stronger version of “Price helpers”.

See it

Try it as a puzzle →

Where an online store's shared helpers for cart prices live in the codebase.

Study A · the stronger one
Study B · the weaker one

Why: A's 'Money = { cents, currency }' makes 'addMoney' check currencies; B's 'addPrices(a: number, b: number)' would happily add dollars to euros.

Related words

  • Single responsibility principle
  • Flag argument
  • Side effect
  • Parameter object
  • Long parameter list
  • Named arguments
  • Options object
  • Utils file

Room 3 · Functions & structure

Learn “Domain type” in a five-minute lesson

Start free
AI can build almost anything. The bottleneck is saying what you want.
WordsPricingTermsPrivacyRefundsContact
© 2026 Briefle