{"id":"6b09a4b7ff996234422a26c4","slug":"law-of-demeter","title":"Prawo Demeter: rozmawiaj tylko z przyjaciółmi","summary":"Prawo Demeter (zasada minimalnej wiedzy) na przykładzie wymiany punktów lojalnościowych w pierogarni Haliny: łańcuchy wywołań kontra „mów, nie pytaj”, wyjątki dla interfejsów płynnych i DTO, kod w C#, TypeScript, Javie, Go i Pythonie oraz związek z hermetyzacją i metrykami sprzężeń.","servedLang":"pl","availableLangs":["pl","en"],"topics":["law-of-demeter","facade","mediator"],"techs":["dotnet","typescript","java","go","python"],"tags":["law-of-demeter","principles","tell-dont-ask","encapsulation","coupling","code-smells"],"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":15,"stats":{"views":0,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-27T15:41:43.080Z","updatedAt":"2026-11-27T15:41:53.847Z","requestedLang":"pl","theme":{"hero":"classic","heroMedia":null,"accent":"amber","background":"grid","weaveResources":true,"toc":"right"},"seoDescription":"Prawo Demeter (Law of Demeter, zasada minimalnej wiedzy): train wreck a.getB().getC().doX() kontra Tell, Don't Ask, wyjątki – interfejsy płynne, buildery, DTO – kod w C#, TypeScript, Java, Go i Python, hermetyzacja i metryki CBO i RFC.","wordCount":2809,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Klient pierogarni Haliny płaci za zamówienie punktami z programu lojalnościowego: 200 punktów to 20 zł rabatu. Kod kasy zna przy tym całe drzewo genealogiczne zamówienia: "},{"type":"text","text":"order.getCustomer().getLoyaltyAccount().getBalance().getPoints()","marks":[{"type":"code"}]},{"type":"text","text":". "},{"type":"text","text":"Prawo Demeter","marks":[{"type":"bold"}]},{"type":"text","text":" (ang. "},{"type":"text","text":"Law of Demeter","marks":[{"type":"italic"}]},{"type":"text","text":"), nazywane też zasadą minimalnej wiedzy (ang. "},{"type":"text","text":"Principle of Least Knowledge","marks":[{"type":"italic"}]},{"type":"text","text":"), mówi: obiekt rozmawia tylko ze swoimi bezpośrednimi współpracownikami, a nie z ich wnętrzem."}]},{"type":"callout","attrs":{"variant":"tip","title":"W skrócie"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Metoda wywołuje metody swojego obiektu, parametrów, obiektów, które sama utworzyła, i swoich pól – ale nie obiektów zwróconych przez te wywołania."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Zamiast wyciągać dane i decydować za kogoś („pytaj”), poproś obiekt, żeby sam wykonał pracę („mów”)."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Liczy się liczba "},{"type":"text","text":"typów","marks":[{"type":"bold"}]},{"type":"text","text":", które poznaje wywołujący, a nie liczba kropek: interfejsy płynne i struktury danych to nie naruszenia."}]}]}]}]},{"type":"stats","attrs":{"items":[{"value":"1987","label":"Northeastern University","hint":"Ian Holland formułuje zasadę w projekcie Demeter"},{"value":"5 → 1","label":"klasy znane kasie","hint":"przed refaktoryzacją i po niej"},{"value":"4","label":"rodzaje „przyjaciół” metody","hint":"jej obiekt, parametry, utworzone obiekty i pola"}]}},{"type":"heading","attrs":{"level":2,"id":"skad-sie-wzielo-prawo-demeter"},"content":[{"type":"text","text":"Skąd się wzięło prawo Demeter"}]},{"type":"paragraph","content":[{"type":"text","text":"Zasadę sformułował w 1987 roku Ian Holland w projekcie Demeter na Northeastern University, prowadzonym przez Karla Lieberherra. Nazwa pochodzi od projektu, a projekt – od greckiej bogini rolnictwa: chodziło o oprogramowanie, które „rośnie” stopniowo. Rok później Lieberherr, Holland i Riel opisali zasadę na konferencji OOPSLA. Potoczna wersja brzmi: rozmawiaj tylko z przyjaciółmi, nie rozmawiaj z nieznajomymi."}]},{"type":"paragraph","content":[{"type":"text","text":"Formalnie metoda "},{"type":"text","text":"m","marks":[{"type":"code"}]},{"type":"text","text":" obiektu "},{"type":"text","text":"O","marks":[{"type":"code"}]},{"type":"text","text":" może wywoływać metody tylko następujących „przyjaciół”:"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Przyjaciel"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Przykład w "},{"type":"text","text":"Order.redeemPoints","marks":[{"type":"code"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"sam obiekt "},{"type":"text","text":"O","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"this.applyDiscount(...)","marks":[{"type":"code"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"parametry metody "},{"type":"text","text":"m","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"points","marks":[{"type":"code"}]},{"type":"text","text":" przekazane przez kasę"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"obiekty utworzone w "},{"type":"text","text":"m","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"new Discount(...)","marks":[{"type":"code"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"pola (komponenty) obiektu "},{"type":"text","text":"O","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"this.customer.redeemPoints(...)","marks":[{"type":"code"}]}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Oryginalne sformułowanie dopuszcza też zmienne globalne dostępne w zasięgu metody – dziś traktujemy je raczej jako problem niż przyjaciela. Nie wolno natomiast wołać metod obiektów "},{"type":"text","text":"zwróconych","marks":[{"type":"bold"}]},{"type":"text","text":" przez te wywołania: "},{"type":"text","text":"this.customer.getLoyaltyAccount().redeem(...)","marks":[{"type":"code"}]},{"type":"text","text":" rozmawia już z nieznajomym."}]},{"type":"heading","attrs":{"level":2,"id":"problem-kasa-ktora-wie-za-duzo"},"content":[{"type":"text","text":"Problem: kasa, która wie za dużo"}]},{"type":"paragraph","content":[{"type":"text","text":"Pierwsza wersja wymiany punktów powstała w kasie (ang. "},{"type":"text","text":"checkout","marks":[{"type":"italic"}]},{"type":"text","text":"), bo „tam są potrzebne”:"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"checkout-before.ts"},"content":[{"type":"text","text":"// Before: Checkout reaches through Order → Customer → LoyaltyAccount → Balance.\nfunction redeemPoints(order: Order, points: number): void {\n  const balance = order.getCustomer().getLoyaltyAccount().getBalance();\n  if (balance.getPoints() < points) throw new Error('Not enough points');\n\n  const discount = points * 10; // 1 point = 10 grosze – a loyalty rule leaked into Checkout\n  if (discount > order.getTotal().getGrosze()) throw new Error('Discount larger than the order');\n\n  balance.setPoints(balance.getPoints() - points);\n  order.getTotal().setGrosze(order.getTotal().getGrosze() - discount);\n}"}]},{"type":"paragraph","content":[{"type":"text","text":"Takie łańcuchy nazywa się "},{"type":"text","text":"train wreck","marks":[{"type":"italic"}]},{"type":"text","text":" – wagony kropek sprzęgnięte jeden za drugim. Martin Fowler w "},{"type":"text","text":"Refactoring","marks":[{"type":"italic"}]},{"type":"text","text":" opisuje je jako zapach kodu "},{"type":"text","text":"Message Chains","marks":[{"type":"italic"}]},{"type":"text","text":". Co jest z nimi nie tak?"}]},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Kasa zna pięć klas","marks":[{"type":"bold"}]},{"type":"text","text":" – zamówienie, klienta, konto lojalnościowe, saldo i kwotę – oraz to, jak są ze sobą połączone. Każda zmiana tej struktury psuje kod. Ten sam łańcuch był też w API aplikacji mobilnej i w panelu administratora, więc gdy punkty przeniesiono do osobnego portfela klienta, poprawki objęły trzy miejsca."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Reguła programu lojalnościowego wyciekła.","marks":[{"type":"bold"}]},{"type":"text","text":" Przelicznik „1 punkt = 10 groszy” mieszka w kasie, a pewnie też w aplikacji mobilnej (zob. "},{"type":"text","text":"DRY","marks":[{"type":"link","attrs":{"href":"/pl/topics/dry"}}]},{"type":"text","text":")."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Najpierw pytaj, potem działaj.","marks":[{"type":"bold"}]},{"type":"text","text":" Kod odczytuje saldo, sam decyduje i zapisuje wynik przez settery. Niezmiennika „saldo nie spada poniżej zera” pilnuje wywołujący, a nie obiekt, który to saldo ma."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Atrapy zwracające atrapy.","marks":[{"type":"bold"}]},{"type":"text","text":" Żeby przetestować kasę, trzeba zbudować atrapę zamówienia, która zwraca atrapę klienta, która zwraca atrapę konta…"}]}]}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart LR\n  subgraph Przed[\"Przed: łańcuch\"]\n    C1[\"Checkout\"] --> O1[\"Order\"]\n    C1 --> CU1[\"Customer\"]\n    C1 --> L1[\"LoyaltyAccount\"]\n    C1 --> B1[\"Balance\"]\n    C1 --> M1[\"Money\"]\n  end\n  subgraph Po[\"Po: tylko przyjaciele\"]\n    C2[\"Checkout\"] --> O2[\"Order\"]\n    O2 --> CU2[\"Customer\"]\n    CU2 --> L2[\"LoyaltyAccount\"]\n  end","caption":"Kogo zna kasa: przed refaktoryzacją i po niej"}},{"type":"heading","attrs":{"level":2,"id":"rozwiazanie-mow-nie-pytaj"},"content":[{"type":"text","text":"Rozwiązanie: mów, nie pytaj"}]},{"type":"paragraph","content":[{"type":"text","text":"Zasadę "},{"type":"text","text":"Tell, Don't Ask","marks":[{"type":"italic"}]},{"type":"text","text":" („mów, nie pytaj”) spopularyzowali Andy Hunt i Dave Thomas w artykule "},{"type":"text","text":"The Art of Enbugging","marks":[{"type":"italic"}]},{"type":"text","text":" (2003): zamiast pytać obiekt o stan i decydować za niego, powiedz mu, co ma zrobić. Każdy obiekt wykonuje swoją część pracy i rozmawia tylko z sąsiadem: zamówienie zna swoją kwotę i ogranicza rabat, klient przekazuje prośbę swojemu kontu, a konto sprawdza saldo i przelicza punkty."}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"sequenceDiagram\n  participant K as Checkout\n  participant O as Order\n  participant C as Customer\n  participant L as LoyaltyAccount\n  K->>O: redeemPoints(200)\n  O->>C: redeemPoints(200, max 45,90 zł)\n  C->>L: redeem(200, max 45,90 zł)\n  L-->>C: rabat 20,00 zł\n  C-->>O: rabat 20,00 zł\n  Note over O: do zapłaty 25,90 zł","caption":"Wymiana punktów: każdy rozmawia tylko z sąsiadem"}},{"type":"codeGroup","attrs":{"title":"Mów, nie pytaj – wymiana punktów lojalnościowych"},"content":[{"type":"codeBlock","attrs":{"language":"csharp","filename":"Loyalty.cs"},"content":[{"type":"text","text":"var order = new Order(\"A-1042\", new Customer(\"Ania\", new LoyaltyAccount(initialPoints: 250)), totalGrosze: 4_590);\norder.RedeemPoints(200);  // Checkout talks only to its friend: the order\nConsole.WriteLine(order); // A-1042: 25.90 zł, Ania has 50 points left\n\npublic sealed class LoyaltyAccount(int initialPoints)\n{\n    private const int GroszePerPoint = 10;\n    public int Points { get; private set; } = initialPoints;\n\n    // Tell the account to redeem – don't read its balance and do the maths outside.\n    public long Redeem(int points, long maxDiscountGrosze)\n    {\n        var discount = (long)points * GroszePerPoint;\n        if (points > Points) throw new InvalidOperationException(\"Not enough points\");\n        if (discount > maxDiscountGrosze) throw new InvalidOperationException(\"Discount larger than the order\");\n        Points -= points;\n        return discount;\n    }\n}\n\npublic sealed class Customer(string name, LoyaltyAccount loyalty)\n{\n    public long RedeemPoints(int points, long maxDiscountGrosze) => loyalty.Redeem(points, maxDiscountGrosze);\n    public override string ToString() => $\"{name} has {loyalty.Points} points left\";\n}\n\npublic sealed class Order(string id, Customer customer, long totalGrosze)\n{\n    private long _total = totalGrosze;\n\n    public void RedeemPoints(int points) => _total -= customer.RedeemPoints(points, maxDiscountGrosze: _total);\n\n    public override string ToString() => $\"{id}: {_total / 100}.{_total % 100:00} zł, {customer}\";\n}"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"loyalty.ts"},"content":[{"type":"text","text":"class LoyaltyAccount {\n  private static readonly GROSZE_PER_POINT = 10;\n  constructor(private points: number) {}\n\n  get balance(): number {\n    return this.points;\n  }\n\n  // Tell the account to redeem – don't read its balance and do the maths outside.\n  redeem(points: number, maxDiscount: number): number {\n    const discount = points * LoyaltyAccount.GROSZE_PER_POINT;\n    if (points > this.points) throw new Error('Not enough points');\n    if (discount > maxDiscount) throw new Error('Discount larger than the order');\n    this.points -= points;\n    return discount;\n  }\n}\n\nclass Customer {\n  constructor(private readonly name: string, private readonly loyalty: LoyaltyAccount) {}\n  redeemPoints(points: number, maxDiscount: number): number {\n    return this.loyalty.redeem(points, maxDiscount);\n  }\n  toString(): string {\n    return `${this.name} has ${this.loyalty.balance} points left`;\n  }\n}\n\nclass Order {\n  constructor(private readonly id: string, private readonly customer: Customer, private total: number) {}\n  redeemPoints(points: number): void {\n    this.total -= this.customer.redeemPoints(points, this.total);\n  }\n  toString(): string {\n    return `${this.id}: ${(this.total / 100).toFixed(2)} zł, ${this.customer}`;\n  }\n}\n\nconst order = new Order('A-1042', new Customer('Ania', new LoyaltyAccount(250)), 4_590);\norder.redeemPoints(200);    // Checkout talks only to its friend: the order\nconsole.log(String(order)); // A-1042: 25.90 zł, Ania has 50 points left"}]},{"type":"codeBlock","attrs":{"language":"java","filename":"Loyalty.java"},"content":[{"type":"text","text":"public class Loyalty {\n    public static void main(String[] args) {\n        var order = new Order(\"A-1042\", new Customer(\"Ania\", new LoyaltyAccount(250)), 4_590);\n        order.redeemPoints(200);   // Checkout talks only to its friend: the order\n        System.out.println(order); // A-1042: 25.90 zł, Ania has 50 points left\n    }\n}\n\nclass LoyaltyAccount {\n    private static final int GROSZE_PER_POINT = 10;\n    private int points;\n\n    LoyaltyAccount(int points) { this.points = points; }\n\n    int balance() { return points; }\n\n    // Tell the account to redeem – don't read its balance and do the maths outside.\n    long redeem(int points, long maxDiscountGrosze) {\n        long discount = (long) points * GROSZE_PER_POINT;\n        if (points > this.points) throw new IllegalStateException(\"Not enough points\");\n        if (discount > maxDiscountGrosze) throw new IllegalStateException(\"Discount larger than the order\");\n        this.points -= points;\n        return discount;\n    }\n}\n\nrecord Customer(String name, LoyaltyAccount loyalty) {\n    long redeemPoints(int points, long maxDiscountGrosze) { return loyalty.redeem(points, maxDiscountGrosze); }\n\n    @Override public String toString() { return name + \" has \" + loyalty.balance() + \" points left\"; }\n}\n\nclass Order {\n    private final String id;\n    private final Customer customer;\n    private long total; // grosze\n\n    Order(String id, Customer customer, long total) { this.id = id; this.customer = customer; this.total = total; }\n\n    void redeemPoints(int points) { total -= customer.redeemPoints(points, total); }\n\n    @Override public String toString() { return \"%s: %d.%02d zł, %s\".formatted(id, total / 100, total % 100, customer); }\n}"}]},{"type":"codeBlock","attrs":{"language":"go","filename":"loyalty.go"},"content":[{"type":"text","text":"package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\nconst groszePerPoint = 10\n\nvar (\n\tErrNotEnoughPoints = errors.New(\"not enough points\")\n\tErrDiscountTooBig  = errors.New(\"discount larger than the order\")\n)\n\ntype LoyaltyAccount struct{ points int }\n\nfunc (a *LoyaltyAccount) Balance() int { return a.points }\n\n// Redeem: tell the account what to do instead of reading its balance.\nfunc (a *LoyaltyAccount) Redeem(points int, maxDiscount int64) (int64, error) {\n\tdiscount := int64(points) * groszePerPoint\n\tif points > a.points {\n\t\treturn 0, ErrNotEnoughPoints\n\t}\n\tif discount > maxDiscount {\n\t\treturn 0, ErrDiscountTooBig\n\t}\n\ta.points -= points\n\treturn discount, nil\n}\n\ntype Customer struct {\n\tname    string\n\tloyalty *LoyaltyAccount\n}\n\nfunc (c *Customer) RedeemPoints(points int, maxDiscount int64) (int64, error) {\n\treturn c.loyalty.Redeem(points, maxDiscount)\n}\n\nfunc (c *Customer) String() string { return fmt.Sprintf(\"%s has %d points left\", c.name, c.loyalty.Balance()) }\n\ntype Order struct {\n\tid       string\n\tcustomer *Customer\n\ttotal    int64 // grosze\n}\n\nfunc (o *Order) RedeemPoints(points int) error {\n\tdiscount, err := o.customer.RedeemPoints(points, o.total)\n\tif err != nil {\n\t\treturn err\n\t}\n\to.total -= discount\n\treturn nil\n}\n\nfunc (o *Order) String() string {\n\treturn fmt.Sprintf(\"%s: %d.%02d zł, %s\", o.id, o.total/100, o.total%100, o.customer)\n}\n\nfunc main() {\n\torder := &Order{id: \"A-1042\", customer: &Customer{name: \"Ania\", loyalty: &LoyaltyAccount{points: 250}}, total: 4590}\n\tif err := order.RedeemPoints(200); err != nil { // Checkout talks only to its friend: the order\n\t\tfmt.Println(err)\n\t}\n\tfmt.Println(order) // A-1042: 25.90 zł, Ania has 50 points left\n}"}]},{"type":"codeBlock","attrs":{"language":"python","filename":"loyalty.py"},"content":[{"type":"text","text":"class LoyaltyAccount:\n    GROSZE_PER_POINT = 10\n\n    def __init__(self, points: int) -> None:\n        self._points = points\n\n    @property\n    def balance(self) -> int:\n        return self._points\n\n    def redeem(self, points: int, max_discount: int) -> int:\n        \"\"\"Tell the account to redeem – don't read its balance and do the maths outside.\"\"\"\n        discount = points * self.GROSZE_PER_POINT\n        if points > self._points:\n            raise ValueError(\"Not enough points\")\n        if discount > max_discount:\n            raise ValueError(\"Discount larger than the order\")\n        self._points -= points\n        return discount\n\n\nclass Customer:\n    def __init__(self, name: str, loyalty: LoyaltyAccount) -> None:\n        self._name = name\n        self._loyalty = loyalty\n\n    def redeem_points(self, points: int, max_discount: int) -> int:\n        return self._loyalty.redeem(points, max_discount)\n\n    def __str__(self) -> str:\n        return f\"{self._name} has {self._loyalty.balance} points left\"\n\n\nclass Order:\n    def __init__(self, order_id: str, customer: Customer, total: int) -> None:\n        self._id = order_id\n        self._customer = customer\n        self._total = total  # grosze\n\n    def redeem_points(self, points: int) -> None:\n        self._total -= self._customer.redeem_points(points, self._total)\n\n    def __str__(self) -> str:\n        return f\"{self._id}: {self._total // 100}.{self._total % 100:02d} zł, {self._customer}\"\n\n\norder = Order(\"A-1042\", Customer(\"Ania\", LoyaltyAccount(250)), 4590)\norder.redeem_points(200)  # Checkout talks only to its friend: the order\nprint(order)  # A-1042: 25.90 zł, Ania has 50 points left"}]}]}]},"toc":[{"id":"skad-sie-wzielo-prawo-demeter","text":"Skąd się wzięło prawo Demeter","level":2,"locked":false},{"id":"problem-kasa-ktora-wie-za-duzo","text":"Problem: kasa, która wie za dużo","level":2,"locked":false},{"id":"rozwiazanie-mow-nie-pytaj","text":"Rozwiązanie: mów, nie pytaj","level":2,"locked":false},{"id":"wyjatki-interfejsy-plynne-dto-i-zapytania","text":"Wyjątki: interfejsy płynne, DTO i zapytania","level":2,"locked":true},{"id":"hermetyzacja-i-metryki-sprzezen","text":"Hermetyzacja i metryki sprzężeń","level":2,"locked":true},{"id":"kiedy-stosowac-a-kiedy-nie","text":"Kiedy stosować, a kiedy nie","level":2,"locked":true},{"id":"w-praktyce","text":"W praktyce","level":2,"locked":true},{"id":"powiazania","text":"Powiązania","level":2,"locked":true},{"id":"sprawdz-sie","text":"Sprawdź się","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":47,"visibleBlocks":18,"resources":[{"id":"6b0857be3c96f2d34d0b41fe","type":"article","provider":"web","url":"https://martinfowler.com/bliki/TellDontAsk.html","embedUrl":null,"title":"bliki: Tell Dont Ask","description":"a bliki entry for Tell Dont Ask","author":"Martin Fowler","thumbnailUrl":"https://martinfowler.com/bliki/images/tellDontAsk/sketch.png","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["martin-fowler"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":75,"verifiedAt":"2026-11-26T11:07:17.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857be3c96f2d34d0b41f3","type":"article","provider":"web","url":"https://martinfowler.com/bliki/FluentInterface.html","embedUrl":null,"title":"bliki: Fluent Interface","description":"A fluent interface is a way of building an API so that its use has the feel of an internal domain-specific language.","author":"Martin Fowler","thumbnailUrl":"https://martinfowler.com/logo-sq.png","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["martin-fowler"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":75,"verifiedAt":"2026-11-26T11:07:28.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857b83c96f2d34d0b3c81","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/pl/podcast/17-o-prawie-demeter-clean-code-i-zasadach-solid-z-piotrem/id1508298430?i=1000493704813","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id1508298430?i=1000493704813","title":"17. O prawie Demeter, Clean Code i zasadach SOLID z Piotrem Stawirejem","description":"Materiały dodatkowe: Definicja Law of Demeter, WikipediaClean Code: A Handbook of Agile Software Craftsmanship, Robert C. Martin, klasyczna książka Uncle Boba na temat czystego koduAgile Principles, Patterns, and Practices in C#, Robert C. Martin, Mikah MartinTest Driven Development: By Example…","author":"Better Software Design","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/a9/6d/bb/a96dbb46-a01a-9cf6-40ef-27a27cef3c73/mza_18038037312547630971.jpg/600x600bb.jpg","durationSec":3883,"lang":"pl","topics":["ddd-strategic-design","solid","law-of-demeter"],"techs":["dotnet"],"tags":["podcast","testing","clean-code","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2020-10-05T23:00:00.000Z","popularity":62,"verifiedAt":"2026-11-26T11:02:40.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:55.661Z","updatedAt":"2026-11-26T16:00:55.661Z"},{"id":"6b0857c33c96f2d34d0b469b","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL16955281W","embedUrl":null,"title":"Growing object-oriented software, guided by tests","description":"","author":"Steve Freeman","thumbnailUrl":"https://covers.openlibrary.org/b/id/9937887-L.jpg","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["book","testing"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"2010-01-01T00:00:00.000Z","popularity":46,"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":"6b0857c43c96f2d34d0b46f1","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL17424491W","embedUrl":null,"title":"Practical Object Oriented Design In Ruby","description":"","author":"Sandi Metz","thumbnailUrl":"https://covers.openlibrary.org/b/id/7551361-L.jpg","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["book"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"2012-01-01T00:00:00.000Z","popularity":39,"verifiedAt":"2026-11-26T11:00:08.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:07.480Z","updatedAt":"2026-11-26T16:01:07.480Z"},{"id":"6b0857c33c96f2d34d0b4650","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL5748544W","embedUrl":null,"title":"The Pragmatic Programmer: From Journeyman to Master","description":"","author":"Andrew Hunt, Dave Thomas","thumbnailUrl":"https://covers.openlibrary.org/b/id/10143650-L.jpg","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["book"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"1999-01-01T00:00:00.000Z","popularity":79,"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"}],"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":"design-principles","title":"Zasady projektowania","items":[{"slug":"kiss","title":"KISS: najprostsze działające rozwiązanie zwykle wygrywa","current":false},{"slug":"dry","title":"DRY: jedna wiedza, jedno miejsce – i kiedy duplikacja jest tańsza","current":false},{"slug":"yagni","title":"YAGNI: nie buduj na zapas – ile kosztuje funkcja, której nikt nie zamówił","current":false},{"slug":"law-of-demeter","title":"Prawo Demeter: rozmawiaj tylko z przyjaciółmi","current":true},{"slug":"solid","title":"SOLID: pięć zasad projektowania obiektowego bez mitów","current":false}]}],"prev":{"slug":"yagni","title":"YAGNI: nie buduj na zapas – ile kosztuje funkcja, której nikt nie zamówił"},"next":{"slug":"solid","title":"SOLID: pięć zasad projektowania obiektowego bez mitów"},"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":104,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Autorytet","articles":90},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Autorytet","articles":61},{"key":"python","title":"Python","level":5,"levelLabel":"Autorytet","articles":59},{"key":"java","title":"Java","level":5,"levelLabel":"Autorytet","articles":46}]}}