#### At First Sight of Builder Pattern

The first time I encountered the Builder Pattern would date back to the beautiful internship time in Red Hat. What inspired me a lot is its strange setter way.

The function will return object itself, in setter methods. Also these setter methods can avoid too many parameters in a function invocation process, such as:

At the first glance of the above Builder Pattern usage, it resoved the too many parameters problem. However, when doWork() function invoke the PeopleBuilder class, it looks really strange and weild. Now the PeopleBuilder looks more like a POJO but a Builder. The get methods in Builder really strange. So the most important thing to do is to just figure out what the adventages and disadvantages do the builder pattern suit: 1. if you find that there are too many parameters in a function invocation, you could take a consideration: could it be encapsulated into a Java Bean Object. and with necessary *get, ***set* methods. 2. *Still, you find that the encapsulated class could not satify with your requirement. some construct parameters are necessary for you and some a optional. But all they could only be assigned value at first construct stage of the object. The object become read only, and be immutable. 3. Then, Builder Pattern is becoming your first choice.

#### An Example of Classical Builder Pattern.

mail sender builder

So long and thanks for all the fish!