{"id":"6b08bd3380884893657cc956","slug":"facade","title":"Fasada (Facade) – jedno proste wejście do skomplikowanego podsystemu","summary":"Fasada udostępnia jedną wygodną operację, która w środku koordynuje wiele klas podsystemu. Przykład zapisu na kurs z płatnością, dostępem i e-mailem powitalnym w C#, TypeScript, Javie, Go i Pythonie.","servedLang":"pl","availableLangs":["pl","en"],"topics":["facade","adapter","mediator","layered-architecture"],"techs":["dotnet","typescript","java","go","python"],"tags":["gof","structural","facade","orchestration","api-design"],"level":"beginner","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:55.487Z","updatedAt":"2026-11-27T10:04:44.619Z","requestedLang":"pl","theme":{"hero":"minimal","heroMedia":null,"accent":"indigo","background":"hex","weaveResources":true,"toc":"right"},"seoDescription":"Wzorzec Fasada (Facade) – problem klientów znających zbyt wiele klas, orkiestracja podsystemu, diagramy, kod w C#, TypeScript, Java, Go i Python, różnice względem Adaptera i Mediatora, przykłady z .NET, Javy, Go i Pythona.","wordCount":1902,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Żeby zapisać studenta na kurs, trzeba znaleźć albo utworzyć konto, pobrać płatność, nadać dostęp do materiałów i wysłać e-mail powitalny – w tej kolejności i z obsługą błędów pomiędzy. "},{"type":"text","text":"Fasada","marks":[{"type":"bold"}]},{"type":"text","text":" (ang. "},{"type":"text","text":"Facade","marks":[{"type":"italic"}]},{"type":"text","text":") zamyka tę choreografię w jednej metodzie "},{"type":"text","text":"enroll()","marks":[{"type":"code"}]},{"type":"text","text":", dzięki czemu kontroler, zadanie wsadowe i panel administratora nie muszą znać czterech klas ani ich wzajemnych zależności."}]},{"type":"callout","attrs":{"variant":"info","title":"W skrócie"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Fasada to klasa z kilkoma wysokopoziomowymi operacjami, które delegują do wielu klas podsystemu."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Klient zależy od fasady, a nie od szczegółów – podsystem można przebudować bez zmian w klientach."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Fasada nie zabrania bezpośredniego dostępu do podsystemu; po prostu czyni typowy przypadek prostym."}]}]}]}]},{"type":"stats","attrs":{"items":[{"value":"4","label":"klasy podsystemu","hint":"konta, płatności, dostęp, poczta"},{"value":"1","label":"wywołanie dla klienta","hint":"enroll(email, kurs, cena)"},{"value":"0","label":"zmian w podsystemie","hint":"fasada tylko go koordynuje"}]}},{"type":"heading","attrs":{"level":2,"id":"problem-kazdy-klient-zna-cala-choreografie"},"content":[{"type":"text","text":"Problem: każdy klient zna całą choreografię"}]},{"type":"paragraph","content":[{"type":"text","text":"Platforma kursów ma trzy miejsca, w których student zostaje zapisany: zakup na stronie, import listy uczestników od firmy i ręczne dodanie przez administratora. Każde z nich wygląda mniej więcej tak:"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"checkout-controller.ts"},"content":[{"type":"text","text":"const userId = accounts.findOrCreate(email);\nconst paymentId = billing.charge(userId, price);\ntry {\n  access.grant(userId, courseId);\n} catch (e) {\n  billing.refund(paymentId); // someone forgot this in the admin panel\n  throw e;\n}\nmailer.sendWelcome(email, courseId);"}]},{"type":"paragraph","content":[{"type":"text","text":"Kod jest skopiowany trzy razy i w każdym miejscu nieco inny. W panelu administratora ktoś zapomniał o zwrocie pieniędzy przy błędzie nadawania dostępu, a import firmowy nie wysyła e-maili. Gdy dojdzie nowy krok – na przykład dodanie do kanału społeczności – trzeba będzie znaleźć i poprawić wszystkie kopie."}]},{"type":"heading","attrs":{"level":2,"id":"rozwiazanie-jedna-klasa-ktora-zna-kolejnosc"},"content":[{"type":"text","text":"Rozwiązanie: jedna klasa, która zna kolejność"}]},{"type":"paragraph","content":[{"type":"text","text":"Tworzymy "},{"type":"text","text":"EnrollmentFacade","marks":[{"type":"code"}]},{"type":"text","text":" z jedną metodą "},{"type":"text","text":"enroll(email, courseId, priceCents)","marks":[{"type":"code"}]},{"type":"text","text":". Fasada otrzymuje klasy podsystemu w konstruktorze i wywołuje je we właściwej kolejności, łącznie z kompensacją (zwrotem płatności), gdy coś pójdzie nie tak. Wszyscy trzej klienci wołają tylko fasadę."}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart LR\n  W[\"Zakup na stronie\"] --> F[\"EnrollmentFacade\"]\n  I[\"Import firmowy\"] --> F\n  A[\"Panel administratora\"] --> F\n  subgraph P[\"Podsystem zapisów\"]\n    AC[\"Accounts\"]\n    BI[\"Billing\"]\n    CA[\"CourseAccess\"]\n    MA[\"Mailer\"]\n  end\n  F --> AC\n  F --> BI\n  F --> CA\n  F --> MA\n  R[\"Raport finansowy\"] -.-> BI","caption":"Klienci rozmawiają z fasadą; podsystem pozostaje dostępny dla przypadków specjalnych"}},{"type":"diagram","attrs":{"kind":"mermaid","code":"sequenceDiagram\n  participant K as Klient\n  participant F as EnrollmentFacade\n  participant A as Accounts\n  participant B as Billing\n  participant C as CourseAccess\n  participant M as Mailer\n  K->>F: enroll(email, kurs, cena)\n  F->>A: findOrCreate(email)\n  F->>B: charge(userId, cena)\n  F->>C: grant(userId, kurs)\n  alt nadanie dostępu się nie udało\n    F->>B: refund(paymentId)\n  end\n  F->>M: sendWelcome(email, kurs)\n  F-->>K: potwierdzenie zapisu","caption":"Co dzieje się w środku enroll()"}},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Rola"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"W przykładzie"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Odpowiedzialność"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fasada ("},{"type":"text","text":"Facade","marks":[{"type":"italic"}]},{"type":"text","text":")"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"EnrollmentFacade","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"zna kolejność kroków i deleguje do podsystemu"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Klasy podsystemu"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Accounts","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"Billing","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"CourseAccess","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"Mailer","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"właściwa praca; nic nie wiedzą o fasadzie"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Klienci"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"kontroler zakupu, import, panel admina"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"korzystają z jednej operacji wysokiego poziomu"}]}]}]}]},{"type":"heading","attrs":{"level":2,"id":"implementacja-w-pieciu-jezykach"},"content":[{"type":"text","text":"Implementacja w pięciu językach"}]},{"type":"paragraph","content":[{"type":"text","text":"Klasy podsystemu są tu celowo uproszczone – w prawdziwym systemie to osobne moduły, często z własnymi bazami albo zewnętrznymi API. Ważne jest to, co robi fasada: ustala kolejność, obsługuje kompensację i zwraca klientowi jeden, zrozumiały wynik."}]},{"type":"codeGroup","attrs":{"title":"EnrollmentFacade"},"content":[{"type":"codeBlock","attrs":{"language":"csharp","filename":"Enrollment.cs"},"content":[{"type":"text","text":"var enrollment = new EnrollmentFacade(new Accounts(), new Billing(), new CourseAccess(), new Mailer());\nConsole.WriteLine(enrollment.Enroll(\"ola@example.com\", \"design-patterns\", priceCents: 19900));\n\n// Subsystem classes: each is fine on its own, but callers must use them in the right order.\npublic sealed class Accounts\n{\n    public string FindOrCreate(string email) => $\"user:{email}\";\n}\n\npublic sealed class Billing\n{\n    public string Charge(string userId, long amountCents) => $\"pay_{amountCents}\";\n    public void Refund(string paymentId) => Console.WriteLine($\"refunded {paymentId}\");\n}\n\npublic sealed class CourseAccess\n{\n    public void Grant(string userId, string courseId) => Console.WriteLine($\"access: {userId} -> {courseId}\");\n}\n\npublic sealed class Mailer\n{\n    public void SendWelcome(string email, string courseId) => Console.WriteLine($\"mail to {email}: {courseId}\");\n}\n\n// Facade: one simple operation that hides the orchestration.\npublic sealed class EnrollmentFacade(Accounts accounts, Billing billing, CourseAccess access, Mailer mailer)\n{\n    public string Enroll(string email, string courseId, long priceCents)\n    {\n        var userId = accounts.FindOrCreate(email);\n        var paymentId = billing.Charge(userId, priceCents);\n        try\n        {\n            access.Grant(userId, courseId);\n        }\n        catch\n        {\n            billing.Refund(paymentId); // keep the subsystems consistent\n            throw;\n        }\n        mailer.SendWelcome(email, courseId);\n        return $\"enrolled {userId} in {courseId} ({paymentId})\";\n    }\n}"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"enrollment.ts"},"content":[{"type":"text","text":"// Subsystem classes: each is fine on its own, but callers must use them in the right order.\nclass Accounts {\n  findOrCreate(email: string): string {\n    return `user:${email}`;\n  }\n}\n\nclass Billing {\n  charge(userId: string, amountCents: number): string {\n    return `pay_${amountCents}`;\n  }\n  refund(paymentId: string): void {\n    console.log(`refunded ${paymentId}`);\n  }\n}\n\nclass CourseAccess {\n  grant(userId: string, courseId: string): void {\n    console.log(`access: ${userId} -> ${courseId}`);\n  }\n}\n\nclass Mailer {\n  sendWelcome(email: string, courseId: string): void {\n    console.log(`mail to ${email}: ${courseId}`);\n  }\n}\n\n// Facade: one simple operation that hides the orchestration.\nclass EnrollmentFacade {\n  constructor(\n    private readonly accounts = new Accounts(),\n    private readonly billing = new Billing(),\n    private readonly access = new CourseAccess(),\n    private readonly mailer = new Mailer(),\n  ) {}\n\n  enroll(email: string, courseId: string, priceCents: number): string {\n    const userId = this.accounts.findOrCreate(email);\n    const paymentId = this.billing.charge(userId, priceCents);\n    try {\n      this.access.grant(userId, courseId);\n    } catch (err) {\n      this.billing.refund(paymentId); // keep the subsystems consistent\n      throw err;\n    }\n    this.mailer.sendWelcome(email, courseId);\n    return `enrolled ${userId} in ${courseId} (${paymentId})`;\n  }\n}\n\nconsole.log(new EnrollmentFacade().enroll(\"ola@example.com\", \"design-patterns\", 19900));"}]},{"type":"codeBlock","attrs":{"language":"java","filename":"Enrollment.java"},"content":[{"type":"text","text":"// Subsystem classes: each is fine on its own, but callers must use them in the right order.\nclass Accounts {\n    String findOrCreate(String email) { return \"user:\" + email; }\n}\n\nclass Billing {\n    String charge(String userId, long amountCents) { return \"pay_\" + amountCents; }\n    void refund(String paymentId) { System.out.println(\"refunded \" + paymentId); }\n}\n\nclass CourseAccess {\n    void grant(String userId, String courseId) { System.out.println(\"access: \" + userId + \" -> \" + courseId); }\n}\n\nclass Mailer {\n    void sendWelcome(String email, String courseId) { System.out.println(\"mail to \" + email + \": \" + courseId); }\n}\n\n// Facade: one simple operation that hides the orchestration.\nfinal class EnrollmentFacade {\n    private final Accounts accounts;\n    private final Billing billing;\n    private final CourseAccess access;\n    private final Mailer mailer;\n\n    EnrollmentFacade(Accounts accounts, Billing billing, CourseAccess access, Mailer mailer) {\n        this.accounts = accounts;\n        this.billing = billing;\n        this.access = access;\n        this.mailer = mailer;\n    }\n\n    String enroll(String email, String courseId, long priceCents) {\n        String userId = accounts.findOrCreate(email);\n        String paymentId = billing.charge(userId, priceCents);\n        try {\n            access.grant(userId, courseId);\n        } catch (RuntimeException e) {\n            billing.refund(paymentId); // keep the subsystems consistent\n            throw e;\n        }\n        mailer.sendWelcome(email, courseId);\n        return \"enrolled \" + userId + \" in \" + courseId + \" (\" + paymentId + \")\";\n    }\n}\n\npublic class Enrollment {\n    public static void main(String[] args) {\n        var facade = new EnrollmentFacade(new Accounts(), new Billing(), new CourseAccess(), new Mailer());\n        System.out.println(facade.enroll(\"ola@example.com\", \"design-patterns\", 19_900));\n    }\n}"}]},{"type":"codeBlock","attrs":{"language":"go","filename":"enrollment.go"},"content":[{"type":"text","text":"package main\n\nimport \"fmt\"\n\n// Subsystem types: each is fine on its own, but callers must use them in the right order.\ntype Accounts struct{}\n\nfunc (Accounts) FindOrCreate(email string) string { return \"user:\" + email }\n\ntype Billing struct{}\n\nfunc (Billing) Charge(userID string, cents int64) (string, error) {\n\treturn fmt.Sprintf(\"pay_%d\", cents), nil\n}\n\nfunc (Billing) Refund(paymentID string) { fmt.Println(\"refunded\", paymentID) }\n\ntype CourseAccess struct{}\n\nfunc (CourseAccess) Grant(userID, courseID string) error {\n\tfmt.Println(\"access:\", userID, \"->\", courseID)\n\treturn nil\n}\n\ntype Mailer struct{}\n\nfunc (Mailer) SendWelcome(email, courseID string) { fmt.Println(\"mail to\", email+\":\", courseID) }\n\n// EnrollmentFacade offers one simple operation that hides the orchestration.\ntype EnrollmentFacade struct {\n\tAccounts Accounts\n\tBilling  Billing\n\tAccess   CourseAccess\n\tMailer   Mailer\n}\n\nfunc (f EnrollmentFacade) Enroll(email, courseID string, priceCents int64) (string, error) {\n\tuserID := f.Accounts.FindOrCreate(email)\n\tpaymentID, err := f.Billing.Charge(userID, priceCents)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"charge: %w\", err)\n\t}\n\tif err := f.Access.Grant(userID, courseID); err != nil {\n\t\tf.Billing.Refund(paymentID) // keep the subsystems consistent\n\t\treturn \"\", fmt.Errorf(\"grant access: %w\", err)\n\t}\n\tf.Mailer.SendWelcome(email, courseID)\n\treturn fmt.Sprintf(\"enrolled %s in %s (%s)\", userID, courseID, paymentID), nil\n}\n\nfunc main() {\n\tfmt.Println(EnrollmentFacade{}.Enroll(\"ola@example.com\", \"design-patterns\", 19900))\n}"}]},{"type":"codeBlock","attrs":{"language":"python","filename":"enrollment.py"},"content":[{"type":"text","text":"# Subsystem classes: each is fine on its own, but callers must use them in the right order.\nclass Accounts:\n    def find_or_create(self, email: str) -> str:\n        return f\"user:{email}\"\n\n\nclass Billing:\n    def charge(self, user_id: str, amount_cents: int) -> str:\n        return f\"pay_{amount_cents}\"\n\n    def refund(self, payment_id: str) -> None:\n        print(f\"refunded {payment_id}\")\n\n\nclass CourseAccess:\n    def grant(self, user_id: str, course_id: str) -> None:\n        print(f\"access: {user_id} -> {course_id}\")\n\n\nclass Mailer:\n    def send_welcome(self, email: str, course_id: str) -> None:\n        print(f\"mail to {email}: {course_id}\")\n\n\nclass EnrollmentFacade:\n    \"\"\"One simple operation that hides the orchestration.\"\"\"\n\n    def __init__(self, accounts: Accounts, billing: Billing, access: CourseAccess, mailer: Mailer) -> None:\n        self._accounts = accounts\n        self._billing = billing\n        self._access = access\n        self._mailer = mailer\n\n    def enroll(self, email: str, course_id: str, price_cents: int) -> str:\n        user_id = self._accounts.find_or_create(email)\n        payment_id = self._billing.charge(user_id, price_cents)\n        try:\n            self._access.grant(user_id, course_id)\n        except Exception:\n            self._billing.refund(payment_id)  # keep the subsystems consistent\n            raise\n        self._mailer.send_welcome(email, course_id)\n        return f\"enrolled {user_id} in {course_id} ({payment_id})\"\n\n\nif __name__ == \"__main__\":\n    facade = EnrollmentFacade(Accounts(), Billing(), CourseAccess(), Mailer())\n    print(facade.enroll(\"ola@example.com\", \"design-patterns\", 19_900))"}]}]}]},"toc":[{"id":"problem-kazdy-klient-zna-cala-choreografie","text":"Problem: każdy klient zna całą choreografię","level":2,"locked":false},{"id":"rozwiazanie-jedna-klasa-ktora-zna-kolejnosc","text":"Rozwiązanie: jedna klasa, która zna kolejność","level":2,"locked":false},{"id":"implementacja-w-pieciu-jezykach","text":"Implementacja w pięciu językach","level":2,"locked":false},{"id":"krok-po-kroku","text":"Krok po kroku","level":2,"locked":true},{"id":"kiedy-stosowac-a-kiedy-nie","text":"Kiedy stosować, a kiedy nie","level":2,"locked":true},{"id":"powiazania-z-innymi-wzorcami","text":"Powiązania z innymi wzorcami","level":2,"locked":true},{"id":"w-praktyce","text":"W praktyce","level":2,"locked":true},{"id":"szybki-test","text":"Szybki test","level":2,"locked":true},{"id":"podsumowanie","text":"Podsumowanie","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":35,"visibleBlocks":15,"resources":[{"id":"6b0857a63c96f2d34d0b3222","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=K4FkHVO5iac","embedUrl":"https://www.youtube-nocookie.com/embed/K4FkHVO5iac","title":"Facade Pattern – Design Patterns (ep 9)","description":"","author":"Christopher Okhravi","thumbnailUrl":"https://i.ytimg.com/vi/K4FkHVO5iac/hqdefault.jpg","durationSec":null,"lang":"en","topics":["facade"],"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:38.059Z","updatedAt":"2026-11-26T16:00:38.059Z"},{"id":"6b0857c83c96f2d34d0b4a23","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=hTC3rmRBIxs","embedUrl":"https://www.youtube-nocookie.com/embed/hTC3rmRBIxs","title":"Proxy vs Adapter vs Facade Pattern | Code Walks 012","description":"What is really the difference between the proxy pattern, adapter pattern, and the facade pattern? ► 01:50 Common denominator ► 02:36 The quick explanation ► 03:20 Proxy pattern ► 04:59 Adapter pattern ► 07:10 Facade pattern ARTICLE MENTIONED ►…","author":"Christopher Okhravi","thumbnailUrl":"https://i.ytimg.com/vi/hTC3rmRBIxs/hqdefault.jpg","durationSec":null,"lang":"en","topics":["adapter","facade","proxy"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2016-07-16T09:26:16.000Z","popularity":58,"verifiedAt":"2026-11-26T10:57:20.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:10.095Z","updatedAt":"2026-11-26T16:01:10.095Z"},{"id":"6b0857b13c96f2d34d0b3360","type":"article","provider":"devto","url":"https://dev.to/mayallo/facade-vs-proxy-vs-adapter-design-patterns-3mfa","embedUrl":null,"title":"Facade vs Proxy vs Adapter Design Patterns","description":"Facade vs Proxy vs Adapter Design Patterns Understand the core differences, use cases,...","author":"Mohamed Mayallo","thumbnailUrl":"https://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fmayallo.com%2Fwp-content%2Fuploads%2F2025%2F05%2Fadapter-facade-proxy-design-patterns.avif","durationSec":null,"lang":"en","topics":["adapter","facade","proxy"],"techs":["typescript"],"tags":["design-patterns","software-architecture","designpatterns","architecture","typescript","node"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"devto","publishedAt":"2025-05-12T08:37:54.000Z","popularity":46,"verifiedAt":"2026-11-26T10:52:11.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:49.541Z","updatedAt":"2026-11-26T16:00:49.541Z"},{"id":"6b0857bd3c96f2d34d0b4179","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/decorator-vs-facade-patterns-knowing-when-to-use-them/id955596067?i=1000350783160","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id955596067?i=1000350783160","title":"Decorator vs. Facade Patterns & Knowing When To Use Them","description":"In today's episode I review decorator and facade patterns. I'll go over strengths, weaknesses, similarities and difference between decorator and facade patterns and give tips on determining when to use one or the other. Today's Sponsor is: Digital Ocean Go to https://digitalocean.com to get…","author":"Developer Tea","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts211/v4/b4/63/c5/b463c587-7db3-60c8-9d94-c666f19b4965/mza_12909919570493186543.jpg/600x600bb.jpg","durationSec":633,"lang":"en","topics":["facade"],"techs":["general"],"tags":["podcast","cloud","design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2015-08-28T07:00:00.000Z","popularity":31,"verifiedAt":"2026-11-26T10:57:42.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857be3c96f2d34d0b4238","type":"article","provider":"web","url":"https://refactoring.guru/design-patterns/facade","embedUrl":null,"title":"Facade","description":"Facade is a structural design pattern that provides a simplified interface to a library, a framework, or any other complex set of classes.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"en","topics":["facade"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":70,"verifiedAt":"2026-11-26T11:26:03.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}],"challenges":[{"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"}],"attachments":[],"hasCode":true,"repoUrl":null,"series":[{"slug":"gof-structural","title":"Wzorce strukturalne GoF","items":[{"slug":"adapter","title":"Adapter – jak dogadać się z kodem, który mówi innym językiem","current":false},{"slug":"bridge","title":"Most (Bridge) – dwie osie zmian bez eksplozji klas","current":false},{"slug":"composite","title":"Kompozyt (Composite) – drzewa, w których liść i gałąź wyglądają tak samo","current":false},{"slug":"decorator","title":"Dekorator (Decorator) – dokładanie zachowania warstwa po warstwie","current":false},{"slug":"facade","title":"Fasada (Facade) – jedno proste wejście do skomplikowanego podsystemu","current":true},{"slug":"flyweight","title":"Pyłek (Flyweight) – jak zmieścić w pamięci 60 tysięcy miejsc na stadionie","current":false},{"slug":"proxy","title":"Pełnomocnik (Proxy) – zastępca, który kontroluje dostęp do prawdziwego obiektu","current":false}]}],"prev":{"slug":"decorator","title":"Dekorator (Decorator) – dokładanie zachowania warstwa po warstwie"},"next":{"slug":"flyweight","title":"Pyłek (Flyweight) – jak zmieścić w pamięci 60 tysięcy miejsc na stadionie"},"featured":false,"authorCard":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","headline":"Wzorce projektowe · Architektura · AI i LLM","community":false,"reputation":{"points":3900,"level":{"key":"mentor","label":"Mentor"}},"articles":68,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Autorytet","articles":63},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Autorytet","articles":53},{"key":"python","title":"Python","level":5,"levelLabel":"Autorytet","articles":52},{"key":"java","title":"Java","level":5,"levelLabel":"Autorytet","articles":38}]}}