Skip to content

docs: add interface boundary examples to implementation philosophy#42

Merged
bkrabach merged 1 commit intomicrosoft:mainfrom
colombod:docs/encapsulation-interface-boundaries
Jan 28, 2026
Merged

docs: add interface boundary examples to implementation philosophy#42
bkrabach merged 1 commit intomicrosoft:mainfrom
colombod:docs/encapsulation-interface-boundaries

Conversation

@colombod
Copy link
Contributor

Summary

Adds good/bad examples to IMPLEMENTATION_PHILOSOPHY.md showing why bypassing public interfaces creates fragile code.

Motivation

This PR was motivated by microsoft/amplifier-app-cli#70 which demonstrates a "fix" that reaches into private internal state instead of using public APIs:

# The anti-pattern
bundle_resolver = getattr(resolver, "_bundle", resolver)
activator = getattr(bundle_resolver, "_activator", None)

What's Added

Two new practical examples in the "Practical Examples" section:

  • Bad Example: Bypassing Public Interfaces - shows the anti-pattern of unwrapping internal state
  • Good Example: Respecting Interface Boundaries - shows the correct approach

Plus the key rule: If you can't do something through the public interface, the fix is to extend the interface—not bypass it.

Why IMPLEMENTATION_PHILOSOPHY.md

This is development-time guidance that belongs where developers look when making implementation decisions. The "Practical Examples" section already establishes the pattern of showing good vs bad approaches with code.

Related


🤖 Generated with Amplifier

Co-Authored-By: Amplifier 240397093+microsoft-amplifier@users.noreply.github.com

Add good/bad examples for bypassing vs using public interfaces.

Motivated by microsoft/amplifier-app-cli#70.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@colombod colombod force-pushed the docs/encapsulation-interface-boundaries branch from 720afbc to ef098c2 Compare January 28, 2026 20:20
@bkrabach bkrabach merged commit f834db6 into microsoft:main Jan 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants