Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

patterns/builder/ #55

giscus[bot] bot announced in Announcements
Mar 9, 2023 · 1 comments · 1 reply
Discussion options

patterns/builder/

Intent Separate the construction of a complex object from its representation so that the same construction process can create different representations. Explanation Real-world example Imagine a character generator for a role-playing game. The easiest option is to let the computer create the character for you. If you want to manually select the character details like profession, gender, hair color, etc. the character generation becomes a step-by-step process that completes when all the selections are ready.

https://java-design-patterns.com/patterns/builder/

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

in Hero's class constructor, how can it access to Builder properties if they are marked as private?

You must be logged in to vote
1 reply
Comment options

This is how Java's nested classes work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /