Java Law Of Demeter

Navigation coupling: what the Law of Demeter actually constrains — structure exposure, not dot-counting — and how to tell a train wreck from a legitimate chain. Use when reviewing chains like order.getCustomer().getAddress().getCity(), when a change to one class's shape rippled through files that never mention it, when deciding whether a chain couples the caller to structure or merely reads data, or when a proposed fix would add forwarding methods to every intermediate class. Does not cover designing fluent chains (java-fluent-apis) or where the decision made on the navigated data should live (java-tell-dont-ask).

robsonkades Updated

File contents

robsonkades/agent-skills/tree/main/skills/java-law-of-demeter commit 394a75200e

Frequently asked questions

npx skillmds@latest add robsonkades/java-law-of-demeter