{"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,"articleCount":5,"topicCount":0,"minutes":54,"groups":["creational"],"covers":[],"preview":[{"kind":"article","title":"Factory Method – let the subclass decide what gets created","slug":"factory-method","topicSlug":null},{"kind":"article","title":"Abstract Factory – whole families of objects that fit together","slug":"abstract-factory","topicSlug":null},{"kind":"article","title":"Builder – complex objects step by step","slug":"builder","topicSlug":null},{"kind":"article","title":"Prototype – a new object as a copy of a ready-made template","slug":"prototype","topicSlug":null}],"articleIds":["6b08bd3480884893657cc960","6b08bd2e80884893657cc8d4","6b08bd2f80884893657cc8f2","6b08bd3c80884893657cc9f1","6b08bd3d80884893657cca05"],"items":[{"kind":"article","articleId":"6b08bd3480884893657cc960","slug":"factory-method","topicSlug":null,"title":"Factory Method – let the subclass decide what gets created","summary":"Factory Method separates the algorithm that uses an object from the decision about which exact object is created. A ticket booking example in C#, TypeScript, Java, Go and Python.","readingMinutes":11,"note":"Start here: one overridable method decides what gets created.","cover":null,"group":"creational","icon":"factory","techs":["dotnet","typescript","java","go","python"],"level":"intermediate","status":"available"},{"kind":"article","articleId":"6b08bd2e80884893657cc8d4","slug":"abstract-factory","topicSlug":null,"title":"Abstract Factory – whole families of objects that fit together","summary":"Abstract Factory creates a complete set of related objects from one family and makes sure nobody mixes parts from different sets. An example with two payment provider integrations.","readingMinutes":11,"note":"Whole families of matching objects.","cover":null,"group":"creational","icon":"boxes","techs":["dotnet","typescript","java","go","python"],"level":"intermediate","status":"available"},{"kind":"article","articleId":"6b08bd2f80884893657cc8f2","slug":"builder","topicSlug":null,"title":"Builder – complex objects step by step","summary":"Builder collects an object's parameters in readable steps and hands over a finished, valid product only in build(). A catering order example in C#, TypeScript, Java, Go and Python.","readingMinutes":12,"note":"Complex objects assembled step by step.","cover":null,"group":"creational","icon":"hammer","techs":["dotnet","typescript","java","go","python"],"level":"beginner","status":"available"},{"kind":"article","articleId":"6b08bd3c80884893657cc9f1","slug":"prototype","topicSlug":null,"title":"Prototype – a new object as a copy of a ready-made template","summary":"Prototype creates objects by cloning a configured instance instead of building them from scratch. We explain the difference between shallow and deep copies using exam templates as an example.","readingMinutes":10,"note":"Creating by copying a configured instance.","cover":null,"group":"creational","icon":"copy","techs":["dotnet","typescript","java","go","python"],"level":"intermediate","status":"available"},{"kind":"article","articleId":"6b08bd3d80884893657cca05","slug":"singleton","topicSlug":null,"title":"Singleton – one instance, and the reasons to hand it to a DI container","summary":"Singleton guarantees that a class has exactly one instance available to the whole application. We show thread-safe implementations in five languages and explain why today it is usually better to register the object as a singleton in a DI container.","readingMinutes":10,"note":"One instance – and why a DI container usually does it better.","cover":null,"group":"creational","icon":"circle-dot","techs":["dotnet","typescript","java","go","python"],"level":"beginner","status":"available"}],"others":[{"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},{"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}]}