Five Creational Design Patterns Explained

Creational patterns focus on object creation mechanisms, aiming to create objects in a manner suitable to the situation. They help make a system independent of how its objects are created, composed, and represented. The five creational patterns covered are: Singleton Pattern Factory Method Pattern Abstract Factory Pattern Prototype Pattern Bui ...

Posted on Sat, 25 Jul 2026 16:34:22 +0000 by shivers

Implementing the Factory Method Pattern for Web Crawlers

Simple Factory Limitations Basic factory implementations often suffer from inflexibility when new types need to be added. Consider a web crawler system with different spider types: enum class CrawlerType { TEXT, IMAGE, }; class BasicSpiderFactory { public: static shared_ptr<Spider> CreateCrawler(CrawlerType type) { sw ...

Posted on Wed, 15 Jul 2026 17:22:13 +0000 by splat78423

Abstract Factory Pattern with Registry Implementation

Improving Abstract Factory with Simple Factory The initial implementation of abstract factory pattern presents two major issues: client code violates the open-closed principle, and provider code also breaches this principle. To address the first issue, we can apply simple factory concepts to refactor the abstract factory approach. Instead of ma ...

Posted on Fri, 29 May 2026 23:34:17 +0000 by micheal_newby