{"slug":"chain-of-responsibility","group":"behavioral","title":"Chain of Responsibility","short":"Passes a request along a chain of handlers until one of them deals with it.","icon":"link","aliases":[],"order":301,"status":"available","articleCount":2,"groupTitle":"Behavioral patterns","intro":"","servedLang":"en","primaryArticle":{"id":"6b08bd3080884893657cc8fc","slug":"chain-of-responsibility","title":"Chain of Responsibility: pass it on until someone takes care of it","summary":"The Chain of Responsibility pattern through complaints in a pierogi place: a bot, a shift manager and the owner form a chain, and a complaint travels until it reaches someone authorised. The classic variant and the middleware pipeline, code in five languages.","servedLang":"en","availableLangs":["pl","en"],"topics":["chain-of-responsibility"],"techs":["dotnet","typescript","java","go","python"],"tags":["gof","behavioral","chain-of-responsibility","middleware","pipeline"],"level":"intermediate","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":13,"stats":{"views":3,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:13:52.282Z","updatedAt":"2026-11-27T13:20:51.150Z","challengeCount":1,"quizCount":0},"articles":[{"id":"6b08bd3280884893657cc938","slug":"decorator","title":"Decorator – adding behaviour layer by layer","summary":"Decorator wraps an object in another object with the same interface and adds behaviour before or after the call. An example of caching, retries and logging for an exchange rate provider in C#, TypeScript, Java, Go and Python.","servedLang":"en","availableLangs":["pl","en"],"topics":["decorator","proxy","chain-of-responsibility","composite"],"techs":["dotnet","typescript","java","go","python"],"tags":["gof","structural","decorator","middleware","cross-cutting-concerns"],"level":"intermediate","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":11,"stats":{"views":3,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:13:54.428Z","updatedAt":"2026-11-27T13:08:21.545Z","relation":{"position":2,"primary":false,"mainTopic":{"slug":"decorator","title":"Decorator"}}}],"challenges":[{"id":"6b093dc191bd8fbaf2a0c8c4","slug":"expense-approval-chain","title":"Expense approval chain","summary":"An expense travels through links – receipt check, team lead, manager, director – until someone approves or rejects it. Chain of Responsibility with pluggable links.","servedLang":"en","availableLangs":["pl","en"],"kind":"code","category":"pattern","status":"published","difficulty":"easy","topics":["chain-of-responsibility"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["chain-of-responsibility","approval-workflow","behavioral","middleware"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":10,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:25.083Z"}],"resources":[{"id":"6b0857bf3c96f2d34d0b427b","type":"article","provider":"web","url":"https://refactoring.guru/pl/design-patterns/chain-of-responsibility","embedUrl":null,"title":"Łańcuch zobowiązań / Chain of Responsibility","description":"Łańcuch zobowiązań jest behawioralnym wzorcem projektowym, który pozwala przekazywać żądania wzdłuż łańcucha obiektów obsługujących. Otrzymawszy żądanie, każdy z obiektów obsługujących decyduje o przetworzeniu żądania lub przekazaniu go do kolejnego obiektu obsługującego w łańcuchu.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/pl/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"pl","topics":["chain-of-responsibility"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":65,"verifiedAt":"2026-11-26T11:26:11.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857c33c96f2d34d0b4658","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL6030812W","embedUrl":null,"title":"Design Patterns: Elements of Reusable Object-Oriented Software","description":"","author":"Erich Gamma, John Vlissides, Richard Helm, Ralph Johnson","thumbnailUrl":"https://covers.openlibrary.org/b/id/6601119-L.jpg","durationSec":null,"lang":"en","topics":["factory-method","abstract-factory","builder","prototype","singleton","adapter","bridge","composite","decorator","facade","flyweight","proxy","chain-of-responsibility","command","iterator","mediator","memento","observer","state","strategy","template-method","visitor"],"techs":["general"],"tags":["book","design-patterns"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"1995-01-01T00:00:00.000Z","popularity":71,"verifiedAt":"2026-11-26T11:00:08.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"},{"id":"6b0857c73c96f2d34d0b4969","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=msXtN15qXOE","embedUrl":"https://www.youtube-nocookie.com/embed/msXtN15qXOE","title":"Building a Request Pipeline for Separating Concerns with Pipes & Filters","description":"How do you separate concerns when processing a request? Typical concerns such as Logging, Validation, Exception Handling, Retries, and many more. One way is to build a request pipeline for separating concerns by using the Pipes and Filters pattern. You can also build a pipeline using the Russian…","author":"CodeOpinion","thumbnailUrl":"https://i.ytimg.com/vi/msXtN15qXOE/hqdefault.jpg","durationSec":null,"lang":"en","topics":["event-sourcing"],"techs":["dotnet"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2021-08-18T14:00:17.000Z","popularity":63,"verifiedAt":"2026-11-26T10:53:51.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:10.095Z","updatedAt":"2026-11-26T16:01:10.095Z"},{"id":"6b0857bc3c96f2d34d0b4047","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/design-patterns-iterators-observers-and-chains-oh-my/id769189585?i=1000378375263","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id769189585?i=1000378375263","title":"Design Patterns – Iterators, Observers, and Chains, Oh My","description":"We’re back to the gang of four, continuing with another segment of design patterns. This time we’re talking about some of our favorite Behavioral Design Patterns: Observer, Chain of Responsibilities, Iterator patterns. Also, why the visitor pattern is weird and what it’s like to be raked over hot…","author":"Coding Blocks","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/f0/b6/68/f0b6682f-e8bc-181c-95a9-0756ddf63d6e/mza_3128980961332034780.jpg/600x600bb.jpg","durationSec":3828,"lang":"en","topics":["iterator","visitor"],"techs":["general"],"tags":["podcast","design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2014-11-09T01:53:47.000Z","popularity":44,"verifiedAt":"2026-11-26T10:57:23.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857be3c96f2d34d0b422c","type":"article","provider":"web","url":"https://refactoring.guru/design-patterns/chain-of-responsibility","embedUrl":null,"title":"Chain of Responsibility","description":"Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"en","topics":["chain-of-responsibility"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":70,"verifiedAt":"2026-11-26T11:26:04.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}],"resourceGroups":[{"type":"video","items":[{"id":"6b0857c73c96f2d34d0b4969","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=msXtN15qXOE","embedUrl":"https://www.youtube-nocookie.com/embed/msXtN15qXOE","title":"Building a Request Pipeline for Separating Concerns with Pipes & Filters","description":"How do you separate concerns when processing a request? Typical concerns such as Logging, Validation, Exception Handling, Retries, and many more. One way is to build a request pipeline for separating concerns by using the Pipes and Filters pattern. You can also build a pipeline using the Russian…","author":"CodeOpinion","thumbnailUrl":"https://i.ytimg.com/vi/msXtN15qXOE/hqdefault.jpg","durationSec":null,"lang":"en","topics":["event-sourcing"],"techs":["dotnet"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2021-08-18T14:00:17.000Z","popularity":63,"verifiedAt":"2026-11-26T10:53:51.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:10.095Z","updatedAt":"2026-11-26T16:01:10.095Z"}]},{"type":"podcast","items":[{"id":"6b0857bc3c96f2d34d0b4047","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/design-patterns-iterators-observers-and-chains-oh-my/id769189585?i=1000378375263","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id769189585?i=1000378375263","title":"Design Patterns – Iterators, Observers, and Chains, Oh My","description":"We’re back to the gang of four, continuing with another segment of design patterns. This time we’re talking about some of our favorite Behavioral Design Patterns: Observer, Chain of Responsibilities, Iterator patterns. Also, why the visitor pattern is weird and what it’s like to be raked over hot…","author":"Coding Blocks","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/f0/b6/68/f0b6682f-e8bc-181c-95a9-0756ddf63d6e/mza_3128980961332034780.jpg/600x600bb.jpg","durationSec":3828,"lang":"en","topics":["iterator","visitor"],"techs":["general"],"tags":["podcast","design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2014-11-09T01:53:47.000Z","popularity":44,"verifiedAt":"2026-11-26T10:57:23.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}]},{"type":"article","items":[{"id":"6b0857bf3c96f2d34d0b427b","type":"article","provider":"web","url":"https://refactoring.guru/pl/design-patterns/chain-of-responsibility","embedUrl":null,"title":"Łańcuch zobowiązań / Chain of Responsibility","description":"Łańcuch zobowiązań jest behawioralnym wzorcem projektowym, który pozwala przekazywać żądania wzdłuż łańcucha obiektów obsługujących. Otrzymawszy żądanie, każdy z obiektów obsługujących decyduje o przetworzeniu żądania lub przekazaniu go do kolejnego obiektu obsługującego w łańcuchu.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/pl/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"pl","topics":["chain-of-responsibility"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":65,"verifiedAt":"2026-11-26T11:26:11.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857be3c96f2d34d0b422c","type":"article","provider":"web","url":"https://refactoring.guru/design-patterns/chain-of-responsibility","embedUrl":null,"title":"Chain of Responsibility","description":"Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"en","topics":["chain-of-responsibility"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":70,"verifiedAt":"2026-11-26T11:26:04.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}]},{"type":"book","items":[{"id":"6b0857c33c96f2d34d0b4658","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL6030812W","embedUrl":null,"title":"Design Patterns: Elements of Reusable Object-Oriented Software","description":"","author":"Erich Gamma, John Vlissides, Richard Helm, Ralph Johnson","thumbnailUrl":"https://covers.openlibrary.org/b/id/6601119-L.jpg","durationSec":null,"lang":"en","topics":["factory-method","abstract-factory","builder","prototype","singleton","adapter","bridge","composite","decorator","facade","flyweight","proxy","chain-of-responsibility","command","iterator","mediator","memento","observer","state","strategy","template-method","visitor"],"techs":["general"],"tags":["book","design-patterns"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"1995-01-01T00:00:00.000Z","popularity":71,"verifiedAt":"2026-11-26T11:00:08.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"}]}],"siblings":[{"slug":"chain-of-responsibility","title":"Chain of Responsibility","icon":"link","status":"available","current":true},{"slug":"command","title":"Command","icon":"terminal","status":"available","current":false},{"slug":"iterator","title":"Iterator","icon":"list-ordered","status":"available","current":false},{"slug":"mediator","title":"Mediator","icon":"messages-square","status":"available","current":false},{"slug":"memento","title":"Memento","icon":"save","status":"available","current":false},{"slug":"observer","title":"Observer","icon":"eye","status":"available","current":false},{"slug":"state","title":"State","icon":"toggle-right","status":"available","current":false},{"slug":"strategy","title":"Strategy","icon":"route","status":"available","current":false},{"slug":"template-method","title":"Template Method","icon":"layout-template","status":"available","current":false},{"slug":"visitor","title":"Visitor","icon":"footprints","status":"available","current":false}]}