...

/

Chain of Responsibility Design Pattern

Chain of Responsibility Design Pattern

Learn how to implement the Chain of Responsibility design pattern in Kotlin.

We'll cover the following...

Let’s imagine that there’s a horrible software architect who doesn’t particularly appreciate speaking with people. Hence, while sitting in The Ivory Tower (that’s the name of the cafe they often visit), they wrote a small web application.

If a developer has a question, they shouldn’t approach the software architect directly, oh no! They’ll need to send them a proper request through this system and they shall only answer it if they deem the request worthy.

A filter chain is a ubiquitous concept in web servers. Usually, when a request reaches us, it’s expected that the following is true:

  • Its parameters have already been validated.
  • The user has already been authenticated,
...