Thursday, May 15, 2014

Builder Pattern in Java

Simple Note

(From wiki):
the intention of the builder pattern is to find a solution to the telescoping constructor anti-pattern. The telescoping constructor anti-pattern occurs when the increase of object constructor parameter combination leads to an exponential list of constructors. Instead of using numerous constructors, the builder pattern uses another object, a builder, that receives each initialization parameter step by step and then returns the resulting constructed object at once.


Run to test.

Add base rice and lots of ingredients one by one to DonburiBuilder then build Donburi.


Builder pattern

Grate answer at stackoverflow


No comments:

Post a Comment