...

/

Encapsulating Complex Operations

Encapsulating Complex Operations

Learn which design patterns to use when complex combinations of inputs control the system.

Problem statement

Some internal components of our system need to accept requests with instructions to do some actions.

Over time, the structure of the requests becomes more and more complicated. For example, there might be different objects in our system that end up executing a very similar action, while having completely different sets of inputs.

This may start causing issues in our code by making it less readable. For example, if ...