Standalone conceptPrincipleChapter I · Principles · Building block 6 of 8

Information Hiding

The boundary follows likely reasons for change and protects internal representation.

  1. DecisionMay change internally.
  2. ContractExposes capabilities.
  3. CallerUses only the contract.

Context

Why this is important

Hide changeable design decisions behind a narrow module contract.

A design principle for business and technical module boundaries.

Shop example · Mapping

Contract and internal decision

The example shop remains a modular monolith with seven modules and a shared deployment.

This is how you read the picture

  1. Decision Encapsulation
  2. Contract Interface
  3. Caller Dependency
Contract and internal decision
AspectVisibilityChange location
InterfaceBusiness operationContract stays stable
ImplementationInternal structureModule can change it
The matrix contrasts exposed capability and hidden implementation.

Benefits & limitations

Helps if:

  • The decision concerns an internal representation likely to change.
  • Several callers need the same business capability, not the same storage access.

Boundaries

  • An interface hides a decision only when it does not pass internal details through.
  • Too many small boundaries add coordination overhead and make change harder.

In practice

  1. List the module’s decisions and mark those that may change for business or technical reasons.
  2. Design the smallest contract through which other modules can use a capability; compare it with the callers’ actual needs.
  3. Change an internal representation experimentally and trace which callers need updates. Refine the boundary where unnecessary dependencies become visible.
Read the detailed explanation

Information Hiding comes from Parnas’s module criteria: decompose a system around difficult or likely-to-change design decisions. An interface describes the capability callers need; internal data structures and processes stay inside the module. An implementation can then change while its contract and observable behaviour remain stable.

A table change stays within the Ordering module. Module Boundaries frames ownership; Dependency Inversion explains stable contract direction.

Check your understanding

Test yourself in three stages

  1. ReadingCheck in the picture

    Which side of the boundary contains the changeable table structure?

    View the solution with justification

    The internal implementation of the Ordering module.

  2. ApplyingTransferred to a new situation

    How can Payment request an order confirmation?

    View the solution with justification

    Through a business operation of the Ordering module rather than its tables.

  3. EvaluateWeighing an alternative

    How can you tell that a contract leaks internal decisions?

    View the solution with justification

    Callers must know storage fields or internal processes to use the capability.

Continue on the learning path

Next in Principles & boundaries: Dependency Inversion.