{"id":"6b08bd4080884893657cca57","slug":"gof-structural","title":"GoF structural patterns","description":"Seven patterns about composing classes and objects into larger structures: Adapter, Bridge, Composite, Decorator, Facade, Flyweight and Proxy. Each with a real-life problem, a diagram and code in five languages.","level":"intermediate","cover":null,"order":2,"itemCount":7,"articleCount":7,"topicCount":0,"minutes":78,"groups":["structural"],"covers":[],"preview":[{"kind":"article","title":"Adapter – how to get along with code that speaks another language","slug":"adapter","topicSlug":null},{"kind":"article","title":"Bridge – two axes of change without a class explosion","slug":"bridge","topicSlug":null},{"kind":"article","title":"Composite – trees in which a leaf and a branch look the same","slug":"composite","topicSlug":null},{"kind":"article","title":"Decorator – adding behaviour layer by layer","slug":"decorator","topicSlug":null}],"articleIds":["6b08bd2f80884893657cc8de","6b08bd2f80884893657cc8e8","6b08bd3180884893657cc91a","6b08bd3280884893657cc938","6b08bd3380884893657cc956","6b08bd3480884893657cc96a","6b08bd3d80884893657cc9fb"],"items":[{"kind":"article","articleId":"6b08bd2f80884893657cc8de","slug":"adapter","topicSlug":null,"title":"Adapter – how to get along with code that speaks another language","summary":"Adapter translates the interface of a foreign class into the interface your code expects. An example of integrating a third-party geocoding SDK in C#, TypeScript, Java, Go and Python.","readingMinutes":11,"note":"Start here: make an incompatible interface fit.","cover":null,"group":"structural","icon":"plug","techs":["dotnet","typescript","java","go","python"],"level":"beginner","status":"available"},{"kind":"article","articleId":"6b08bd2f80884893657cc8e8","slug":"bridge","topicSlug":null,"title":"Bridge – two axes of change without a class explosion","summary":"Bridge separates the abstraction (what we do) from the implementation (how we do it), so both hierarchies can evolve independently. An example of notifications and delivery channels in C#, TypeScript, Java, Go and Python.","readingMinutes":11,"note":"Two dimensions of change that grow independently.","cover":null,"group":"structural","icon":"spline","techs":["dotnet","typescript","java","go","python"],"level":"intermediate","status":"available"},{"kind":"article","articleId":"6b08bd3180884893657cc91a","slug":"composite","topicSlug":null,"title":"Composite – trees in which a leaf and a branch look the same","summary":"Composite lets you treat a single object and a whole group of objects in exactly the same way. A course curriculum example with modules and lessons in C#, TypeScript, Java, Go and Python.","readingMinutes":11,"note":"Trees where a leaf and a branch look the same.","cover":null,"group":"structural","icon":"network","techs":["dotnet","typescript","java","go","python"],"level":"intermediate","status":"available"},{"kind":"article","articleId":"6b08bd3280884893657cc938","slug":"decorator","topicSlug":null,"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.","readingMinutes":11,"note":"Add behaviour by wrapping, not by subclassing.","cover":null,"group":"structural","icon":"layers","techs":["dotnet","typescript","java","go","python"],"level":"intermediate","status":"available"},{"kind":"article","articleId":"6b08bd3380884893657cc956","slug":"facade","topicSlug":null,"title":"Facade – one simple entry point to a complex subsystem","summary":"Facade exposes one convenient operation that coordinates many subsystem classes behind the scenes. An example of course enrollment with payment, access and a welcome email in C#, TypeScript, Java, Go and Python.","readingMinutes":11,"note":"One simple entry point to a complex subsystem.","cover":null,"group":"structural","icon":"building","techs":["dotnet","typescript","java","go","python"],"level":"beginner","status":"available"},{"kind":"article","articleId":"6b08bd3480884893657cc96a","slug":"flyweight","topicSlug":null,"title":"Flyweight – how to fit 60,000 stadium seats in memory","summary":"Flyweight separates the state shared by many objects from the state unique to each one, and shares the former. A stadium seat map example from a ticket booking system in C#, TypeScript, Java, Go and Python.","readingMinutes":12,"note":"Share state to fit millions of objects in memory.","cover":null,"group":"structural","icon":"feather","techs":["dotnet","typescript","java","go","python"],"level":"advanced","status":"available"},{"kind":"article","articleId":"6b08bd3d80884893657cc9fb","slug":"proxy","topicSlug":null,"title":"Proxy – a stand-in that controls access to the real object","summary":"Proxy has the same interface as the real object and stands in front of it, deciding when – and whether – to pass a call on. An invoice archive example with access control and a lazy connection in C#, TypeScript, Java, Go and Python.","readingMinutes":11,"note":"A stand-in that controls access to the real object.","cover":null,"group":"structural","icon":"shield","techs":["dotnet","typescript","java","go","python"],"level":"intermediate","status":"available"}],"others":[{"id":"6b08bd4080884893657cca50","slug":"gof-creational","title":"GoF creational patterns","description":"Five ways to stop object creation from being scattered all over your code: from Factory Method through Abstract Factory, Builder and Prototype to Singleton – with examples in C#, TypeScript, Java, Go and Python.","level":"intermediate","cover":null,"order":1,"itemCount":5},{"id":"6b08bd3f80884893657cca49","slug":"gof-behavioral","title":"GoF behavioral patterns","description":"Ten behavioral patterns from the Gang of Four catalog, told through Halina's pierogi place moving online: from Strategy and Observer to Memento and Visitor. Every article has a diagram, code in C#, TypeScript, Java, Go and Python, a quiz and advice on when not to use the pattern.","level":"intermediate","cover":null,"order":3,"itemCount":10},{"id":"6b08bd3f80884893657cca42","slug":"architecture-path","title":"From monolith to microservices","description":"A path through architecture styles in the order you usually meet them in a growing system: from the monolith and modules, through layers, the hexagon, clean and onion architecture and vertical slices, to CQRS, event sourcing, events, microservices and strategic DDD.","level":"intermediate","cover":null,"order":4,"itemCount":12}]}