Knowledge & reflections
Start with Clear API Boundaries
A clear boundary between interface and service makes a system easier to understand, change and maintain. ## Let the service own the rules The interface can guide a user, but the service must validate permissions and business rules. In a shop, for example, the browser submits a product and quantity while the service calculates the current price and checks available stock. ## Make the contract explicit Describe required fields, accepted values, error states and ownership. A missing value and an empty value can mean different things. Use stable identifiers rather than display names to connect records. ## Design for change Keep request code separate from presentation. A shared request layer can handle status codes consistently, while a card or form remains responsible for what the person sees. Small, explicit contracts make that separation practical.