https://github.com/platisd/cpp-builder-pattern
Builder Pattern with C++: A pragmatic approach
https://github.com/platisd/cpp-builder-pattern
cpp design-patterns tutorial
Last synced: 5 months ago
JSON representation
Builder Pattern with C++: A pragmatic approach
- Host: GitHub
- URL: https://github.com/platisd/cpp-builder-pattern
- Owner: platisd
- License: mit
- Created: 2022-12-30T10:20:04.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-01T22:05:17.000Z (about 2 years ago)
- Last Synced: 2025-04-10T01:14:23.487Z (10 months ago)
- Topics: cpp, design-patterns, tutorial
- Language: C++
- Homepage:
- Size: 761 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Builder Pattern: A pragmatic approach with modern C++
A pragmatic approach (i.e. simple and easy to understand) to the [Builder Pattern](https://refactoring.guru/design-patterns/builder)
using modern C++.
Three different ways to implement the Builder Pattern are presented:
* [basic-builder.cpp](basic-builder.cpp): A very basic implementation, so basic that some would argue it's not a Builder Pattern at all.
* [late-access-builder.cpp](late-access-builder.cpp): A more complete Builder that only provides access to the built object after
the initialization is complete.
* [builder-with-interfaces.cpp](builder-with-interfaces.cpp): A "traditional" approach where the "builder" and the "initialized object"
implement abstract interfaces.
## Youtube video
This material was created to accompany a YouTube tutorial. You can watch it here:
[](https://youtu.be/Ag_7sAPv7fQ)