Message Chain

noun

say it: “MES-ij CHAYN” /ˈmɛsɪdʒ tʃeɪn/

A line of calls that reaches through one object to another to get an answer.

What is a message chain?

A message chain is a code smell: a line of calls that walks through one object to another to get an answer, such as booking.member().plan().price(). The caller has to know how the booking, the member and the plan are put together, so a change to any of them touches every place that walks the chain. The usual cure is moving the method: ask the object that has the data, as in booking.monthlyPrice().

In a sentence

  • “Every screen walked the same message chain from the booking to the member to the plan.”

Level: Journeyman · More Software Development terms at this level

Updated