Chapter 15. Builder

The builder pattern moves the construction logic for an object outside the class to instantiate. Making this move might be useful for several reasons. You might simply want to reduce the size of a class that has many methods. You may also want to allow step-by-step construction of a target object. This occurs when you acquire the parameters for a constructor gradually, as happens with parsers and may happen with a user interface.

Get Design Patterns Java™ Workbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.