Chapter 17: The Builder Pattern
In the previous chapter, we covered the first two creational patterns—the factory method and abstract factory, both of which offer approaches to improve the way we create objects in nontrivial cases. The builder design pattern, on the other hand, as we'll discuss in this chapter, is useful for managing objects that consist of multiple parts that need to be implemented sequentially. By decoupling the construction of an object and its representation, the builder pattern allows us to reuse a construction multiple times.
Just as with the previous chapter, we will discuss real-life applications that use this design pattern as well as implementing a hands-on example ourselves.
In this chapter, we will discuss the following topics:
- Understanding the builder pattern
- Real-world examples
- Use cases
- Implementing an ordering application
By the end of the chapter, we will understand how to use the builder pattern and its...