{"slug":"decorator","group":"structural","title":"Dekorator","short":"Dokłada zachowanie przez opakowanie obiektu, zamiast mnożyć podklasy.","icon":"layers","aliases":[],"order":204,"status":"available","articleCount":4,"groupTitle":"Wzorce strukturalne","intro":"","servedLang":"pl","primaryArticle":{"id":"6b08bd3280884893657cc938","slug":"decorator","title":"Dekorator (Decorator) – dokładanie zachowania warstwa po warstwie","summary":"Dekorator owija obiekt innym obiektem o tym samym interfejsie i dodaje zachowanie przed wywołaniem lub po nim. Przykład pamięci podręcznej, ponowień i logowania dla dostawcy kursów walut w C#, TypeScript, Javie, Go i Pythonie.","servedLang":"pl","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":2,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:13:54.428Z","updatedAt":"2026-11-27T10:05:02.230Z","challengeCount":1,"quizCount":1},"articles":[{"id":"6b08bd3d80884893657cc9fb","slug":"proxy","title":"Pełnomocnik (Proxy) – zastępca, który kontroluje dostęp do prawdziwego obiektu","summary":"Pełnomocnik ma ten sam interfejs co prawdziwy obiekt i stoi przed nim, decydując, kiedy i czy w ogóle przekazać wywołanie. Przykład archiwum faktur z kontrolą uprawnień i leniwym połączeniem w C#, TypeScript, Javie, Go i Pythonie.","servedLang":"pl","availableLangs":["pl","en"],"topics":["proxy","decorator","adapter","facade"],"techs":["dotnet","typescript","java","go","python"],"tags":["gof","structural","proxy","lazy-loading","access-control"],"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":10,"stats":{"views":3,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:14:05.076Z","updatedAt":"2026-11-27T10:04:59.090Z","relation":{"position":1,"primary":false,"mainTopic":{"slug":"proxy","title":"Pełnomocnik"}}},{"id":"6b08bd3180884893657cc91a","slug":"composite","title":"Kompozyt (Composite) – drzewa, w których liść i gałąź wyglądają tak samo","summary":"Kompozyt pozwala traktować pojedynczy obiekt i całą grupę obiektów w identyczny sposób. Przykład programu kursu z modułami i lekcjami w C#, TypeScript, Javie, Go i Pythonie.","servedLang":"pl","availableLangs":["pl","en"],"topics":["composite","decorator","iterator","visitor"],"techs":["dotnet","typescript","java","go","python"],"tags":["gof","structural","composite","tree","recursion"],"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":10,"stats":{"views":2,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:13:53.346Z","updatedAt":"2026-11-27T10:05:02.633Z","relation":{"position":1,"primary":false,"mainTopic":{"slug":"composite","title":"Kompozyt"}}},{"id":"6b08bd2f80884893657cc8de","slug":"adapter","title":"Adapter – jak dogadać się z kodem, który mówi innym językiem","summary":"Adapter tłumaczy interfejs obcej klasy na interfejs, którego oczekuje Twój kod. Przykład integracji z zewnętrznym SDK geokodowania w C#, TypeScript, Javie, Go i Pythonie.","servedLang":"pl","availableLangs":["pl","en"],"topics":["adapter","facade","decorator","hexagonal-architecture"],"techs":["dotnet","typescript","java","go","python"],"tags":["gof","structural","adapter","integration","anti-corruption-layer"],"level":"beginner","kind":"article","access":"public","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":10,"stats":{"views":3,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:13:51.251Z","updatedAt":"2026-11-27T11:21:00.350Z","relation":{"position":2,"primary":false,"mainTopic":{"slug":"adapter","title":"Adapter"}}}],"challenges":[{"id":"6b093dddbd4755deb67ee061","slug":"debounce-throttle","title":"Debounce i throttle","summary":"Dwie klasyczne funkcje wyższego rzędu z frontendu – debounce (wywołaj po ciszy) i throttle (najwyżej raz na okres) – z cancel, flush, zachowaniem this i wstrzykiwanymi timerami.","servedLang":"pl","availableLangs":["pl","en"],"kind":"code","category":"algorithms","status":"published","difficulty":"medium","topics":["decorator"],"techs":["typescript","javascript"],"tags":["javascript","closures","timers","event-loop","higher-order-functions"],"languages":["typescript","javascript"],"questionCount":null,"xp":20,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:53.681Z"},{"id":"6b0857af5a2625e44ecaad13","slug":"design-patterns-basics-quiz","title":"Wzorce projektowe – podstawy","summary":"Sześć pytań o klasyczne wzorce GoF: grupy, przeznaczenie i różnice.","servedLang":"pl","availableLangs":["pl","en"],"kind":"quiz","category":null,"status":"published","difficulty":"easy","topics":["builder","adapter","strategy","decorator","composite","facade","observer"],"techs":["general"],"tags":["quiz","gof","basics"],"languages":[],"questionCount":6,"xp":10,"stats":{"attempts":1,"solves":1,"solutions":0,"comments":0},"solveRate":100,"publishedAt":"2026-11-26T16:00:47.960Z"}],"resources":[{"id":"6b0857a53c96f2d34d0b321c","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=GCraGHx6gso","embedUrl":"https://www.youtube-nocookie.com/embed/GCraGHx6gso","title":"Decorator Pattern – Design Patterns (ep 3)","description":"","author":"Christopher Okhravi","thumbnailUrl":"https://i.ytimg.com/vi/GCraGHx6gso/hqdefault.jpg","durationSec":null,"lang":"en","topics":["decorator"],"techs":["general"],"tags":[],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:37.563Z","updatedAt":"2026-11-26T16:00:37.563Z"},{"id":"6b0857be3c96f2d34d0b4208","type":"article","provider":"web","url":"https://refactoring.guru/design-patterns/decorator","embedUrl":null,"title":"Decorator","description":"Decorator is a structural design pattern that lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"en","topics":["decorator"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":75,"verifiedAt":"2026-11-26T11:26:02.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857c73c96f2d34d0b4929","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=gsluG8NdCfw","embedUrl":"https://www.youtube-nocookie.com/embed/gsluG8NdCfw","title":"Building Your Own CQRS Pipeline With Decorators (Dropped MediatR!)","description":"Get the free Clean Architecture template: https://dub.sh/ca-template Want to master Clean Architecture? Go here: https://bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: https://bit.ly/3SXlzSt So… you’ve removed MediatR. But how do you replace pipeline behaviors like logging and…","author":"Milan Jovanović","thumbnailUrl":"https://i.ytimg.com/vi/gsluG8NdCfw/hqdefault.jpg","durationSec":null,"lang":"en","topics":["decorator","modular-monolith","clean-architecture","cqrs"],"techs":["dotnet"],"tags":["design-patterns","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2025-05-16T11:01:28.000Z","popularity":65,"verifiedAt":"2026-11-26T10:54:01.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:10.095Z","updatedAt":"2026-11-26T16:01:10.095Z"},{"id":"6b0857c33c96f2d34d0b4666","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL16942701W","embedUrl":null,"title":"Head First design patterns","description":"","author":"Eric Freeman, Elisabeth Freeman, Kathy Sierra, Bert Bates","thumbnailUrl":"https://covers.openlibrary.org/b/id/388950-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":["java"],"tags":["book","design-patterns"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"2004-01-01T00:00:00.000Z","popularity":62,"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":"6b0857be3c96f2d34d0b4232","type":"article","provider":"web","url":"https://refactoring.guru/pl/design-patterns/decorator","embedUrl":null,"title":"Dekorator / Decorator","description":"Dekorator to strukturalny wzorzec projektowy pozwalający dodawać nowe obowiązki obiektom poprzez umieszczanie tych obiektów w specjalnych obiektach opakowujących, które zawierają odpowiednie zachowania.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/pl/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"pl","topics":["decorator"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":70,"verifiedAt":"2026-11-26T11:26:10.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857be3c96f2d34d0b41d8","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/episode-9-its-the-holidays-lets-decorate/id467641329?i=1000701187991","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id467641329?i=1000701187991","title":"Episode 9. It’s the Holidays! Let’s Decorate!","description":"In this episode we talk about the Decorator pattern and how it is applied. We cover a couple of caveats (especially when combined with the Observer pattern) and learn how to not be afraid of its verboseness. In all, it's the season of decorating, so...","author":"Java Pub House","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/ca/24/a7/ca24a7a6-e926-cc14-223a-444cf4127b70/mza_6810655170352985611.png/600x600bb.jpg","durationSec":null,"lang":"en","topics":["decorator","observer"],"techs":["java"],"tags":["podcast","design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2011-12-02T09:56:11.000Z","popularity":10,"verifiedAt":"2026-11-26T11:04:06.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}],"resourceGroups":[{"type":"video","items":[{"id":"6b0857a53c96f2d34d0b321c","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=GCraGHx6gso","embedUrl":"https://www.youtube-nocookie.com/embed/GCraGHx6gso","title":"Decorator Pattern – Design Patterns (ep 3)","description":"","author":"Christopher Okhravi","thumbnailUrl":"https://i.ytimg.com/vi/GCraGHx6gso/hqdefault.jpg","durationSec":null,"lang":"en","topics":["decorator"],"techs":["general"],"tags":[],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:37.563Z","updatedAt":"2026-11-26T16:00:37.563Z"},{"id":"6b0857c73c96f2d34d0b4929","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=gsluG8NdCfw","embedUrl":"https://www.youtube-nocookie.com/embed/gsluG8NdCfw","title":"Building Your Own CQRS Pipeline With Decorators (Dropped MediatR!)","description":"Get the free Clean Architecture template: https://dub.sh/ca-template Want to master Clean Architecture? Go here: https://bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: https://bit.ly/3SXlzSt So… you’ve removed MediatR. But how do you replace pipeline behaviors like logging and…","author":"Milan Jovanović","thumbnailUrl":"https://i.ytimg.com/vi/gsluG8NdCfw/hqdefault.jpg","durationSec":null,"lang":"en","topics":["decorator","modular-monolith","clean-architecture","cqrs"],"techs":["dotnet"],"tags":["design-patterns","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2025-05-16T11:01:28.000Z","popularity":65,"verifiedAt":"2026-11-26T10:54:01.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:10.095Z","updatedAt":"2026-11-26T16:01:10.095Z"}]},{"type":"podcast","items":[{"id":"6b0857be3c96f2d34d0b41d8","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/episode-9-its-the-holidays-lets-decorate/id467641329?i=1000701187991","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id467641329?i=1000701187991","title":"Episode 9. It’s the Holidays! Let’s Decorate!","description":"In this episode we talk about the Decorator pattern and how it is applied. We cover a couple of caveats (especially when combined with the Observer pattern) and learn how to not be afraid of its verboseness. In all, it's the season of decorating, so...","author":"Java Pub House","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts221/v4/ca/24/a7/ca24a7a6-e926-cc14-223a-444cf4127b70/mza_6810655170352985611.png/600x600bb.jpg","durationSec":null,"lang":"en","topics":["decorator","observer"],"techs":["java"],"tags":["podcast","design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2011-12-02T09:56:11.000Z","popularity":10,"verifiedAt":"2026-11-26T11:04:06.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}]},{"type":"article","items":[{"id":"6b0857be3c96f2d34d0b4208","type":"article","provider":"web","url":"https://refactoring.guru/design-patterns/decorator","embedUrl":null,"title":"Decorator","description":"Decorator is a structural design pattern that lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"en","topics":["decorator"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":75,"verifiedAt":"2026-11-26T11:26:02.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857be3c96f2d34d0b4232","type":"article","provider":"web","url":"https://refactoring.guru/pl/design-patterns/decorator","embedUrl":null,"title":"Dekorator / Decorator","description":"Dekorator to strukturalny wzorzec projektowy pozwalający dodawać nowe obowiązki obiektom poprzez umieszczanie tych obiektów w specjalnych obiektach opakowujących, które zawierają odpowiednie zachowania.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/pl/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"pl","topics":["decorator"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":70,"verifiedAt":"2026-11-26T11:26:10.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}]},{"type":"book","items":[{"id":"6b0857c33c96f2d34d0b4666","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL16942701W","embedUrl":null,"title":"Head First design patterns","description":"","author":"Eric Freeman, Elisabeth Freeman, Kathy Sierra, Bert Bates","thumbnailUrl":"https://covers.openlibrary.org/b/id/388950-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":["java"],"tags":["book","design-patterns"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"2004-01-01T00:00:00.000Z","popularity":62,"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":"adapter","title":"Adapter","icon":"plug","status":"available","current":false},{"slug":"bridge","title":"Most","icon":"spline","status":"available","current":false},{"slug":"composite","title":"Kompozyt","icon":"network","status":"available","current":false},{"slug":"decorator","title":"Dekorator","icon":"layers","status":"available","current":true},{"slug":"facade","title":"Fasada","icon":"building","status":"available","current":false},{"slug":"flyweight","title":"Pyłek","icon":"feather","status":"available","current":false},{"slug":"proxy","title":"Pełnomocnik","icon":"shield","status":"available","current":false}]}