jargon

Design patterns·The named ways it goes wrong

the line is four dots long and a change to any object along the way breaks the code at the end of it.

Message chain

Also calledtrain wreck, chained navigation

Navigating through a chain of objects to reach the one you actually want, which couples the caller to every structure along the path. It is the violation the Law of Demeter names, and the standard fix is to ask the nearest object for what you need so the traversal happens where the structure is known. Fluent interfaces look identical and are not the same thing — each call there returns the same receiver by design.

Commonly confused with