Message Chains
When a client asks one object for another object, then for another object, and another object down a chain. It might look like A.getB().getC().getD().getE()
in a language like Java. It can be quite fragile if there is any change to the structure of an object in the chain - the change propagates and can have wider effects than you’d like. This smell is what you get when you break the Law of Demeter.
Sources
- This smell is included Martin Fowler's book "Refactoring", 2nd Edition
Back to All Code Smells