GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-design-patterns/builder at master · linchangji/java-design-patterns

Expand file tree

/

builder

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

builder

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
etc
etc
 
 
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline
layout pattern
title Builder
folder builder
permalink /patterns/builder/
pumlid DSR94O0m2030LhG0mzzkC64KXs26GzlNZw_TcRLADagJwOWOlW8OFcNdE79B9wkN1ccKUdLWoGS33KwySMdalEioC89C7Jhw5zYIfNrIrFybhPUHNLu0
categories Creational
tags
Java
Gang Of Four
Difficulty-Intermediate

Intent

Separate the construction of a complex object from its representation so that the same construction process can create different representations.

alt text

Applicability

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

Real world examples

  • 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

Credits

  • Design Patterns: Elements of Reusable Object-Oriented Software
  • Effective Java (2nd Edition)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.