Hi Sylvek.

Good eye. Yes, decorator and chain of responsibility are extremely similar and the enricher pattern I describe is in the middle of many of the behavioral patterns.

My only reasoning for not comparing it to the decorator pattern is the classic decorator takes another instance of the same interface that is decorates. The pattern I describe usually doesn’t take another instance, unless it is indeed part of a chain.

Ironically, whenever I start having conversations about “which pattern is this exactly”, once you get into behavioral patterns, they all sorta start to look like each other. They all are different ways to prefer the single responsibility principle and small interfaces over large classes that become hard to add functionality to.

Thanks for reading!

Jesus follower | husband | IJM advocate | software engineer. I share tips and tools for building great software as a team.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store