| layout | pattern | |||
|---|---|---|---|---|
| title | Builder | |||
| folder | builder | |||
| permalink | /patterns/builder/ | |||
| pumlid | DSR94O0m2030LhG0mzzkC64KXs26GzlNZw_TcRLADagJwOWOlW8OFcNdE79B9wkN1ccKUdLWoGS33KwySMdalEioC89C7Jhw5zYIfNrIrFybhPUHNLu0 | |||
| categories | Creational | |||
| tags |
|
Separate the construction of a complex object from its representation so that the same construction process can create different representations.
Use the Builder pattern when
- the algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled
- the construction process must allow different representations for the object that's constructed
- java.lang.StringBuilder
- java.nio.ByteBuffer as well as similar buffers such as FloatBuffer, IntBuffer and so on.
- java.lang.StringBuffer
- All implementations of java.lang.Appendable
- Apache Camel builders
