An internal API, or private API, contains non-public operations and state used inside a component. Its members are implementation details rather than client-facing observable behavior. section 5.2 section 5.5
Classify internal API by asking what the client needs to achieve:
- Expose operations or state that help clients achieve goals through the public API. section 5.2
- Keep code that serves neither client goals nor observable results behind the internal API. section 5.5
- Treat public exposure of implementation details as API leakage, because clients can bypass invariants and tests can couple to fragile internals. section 5.5
Hide normalization behind the observable operation
A User class initially exposes NormalizeName, while RenameUser calls it before assigning Name. The refactoring makes NormalizeName private and normalizes inside the Name setter, leaving user.Name = newName as the simpler public interaction. section 5.2
Figure 5.4. In a well-designed API, the observable behavior coincides with the public API, while all implementation details are hidden behind the private API.
Use the API-boundary diagram to distinguish a well-designed public API from its hidden implementation details. section 5.2


