Back to feed
Dev.to
Dev.to
7/23/2026
The original title is "Pulling Business Rules Out of Your Service Isn't a Rewrite. It's a Seam."

The original title is "Pulling Business Rules Out of Your Service Isn't a Rewrite. It's a Seam."

Original: Pulling Business Rules Out of Your Service Isn't a Rewrite. It's a Seam.

Short summary

The article argues that externalizing business rules is an architecture decision, not a product decision. The key pattern is defining a typed seam: typed inputs and outputs with both compile-time and runtime validation (e.g., Zod parsing) so rule-layer changes fail loudly instead of silently. Code examples in TypeScript and Java show how to replace inline conditionals with a thin rule-client call that maps domain objects to typed rule inputs and back.

  • Externalizing rules is about designing a typed seam, not picking a rule engine
  • Typed inputs/outputs plus runtime schema validation prevent silent shape drift from rule changes
  • TypeScript and Java examples show the same pattern: thin service calls a rule client with compile-time and runtime checks

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more