Does my builder need to be inside a class?
I've just read a fantastic [example][1] of a [builder pattern][2].

In my program I'm creating a series of playerCharacter entities, which can be constructed in various ways, with some compulsory fields and some that can be added on as extra or added latter on (after construction). So, after reading the above post, it seems as though I need a builder pattern.

Do I have the option of the builder and super class (here, in the example `Pizza` and `builder`) sharing some of the methods? **Is there a neat, known solution to this?**

For instance if, in the above example (of the pizza), at a later time we had a method of `Boolean isPizzaCold()` and `void setTemperature(int)` and we wanted the pizza to return false to start with, as it's 'built' hot, and later to let the pizza 'get cold', so that it cools. How would I do this such that they share the same methods?




  [1]: http://stackoverflow.com/a/1953567/1075247
  [2]: http://en.wikipedia.org/wiki/Builder_pattern
Does my builder need to be inside a class?
===

I've just read a fantastic [example][1] of a [builder pattern][2].

In my program I'm creating a series of playerCharacter entities, which can be constructed in various ways, with some compulsory fields and some that can be added on as extra or added latter on (after construction). So, after reading the above post, it seems as though I need a builder pattern.

Do I have the option of the builder and super class (here, in the example `Pizza` and `builder`) sharing some of the methods? **Is there a neat, known solution to this?**

For instance if, in the above example (of the pizza), at a later time we had a method of `Boolean isPizzaCold()` and `void setTemperature(int)` and we wanted the pizza to return false to start with, as it's 'built' hot, and later to let the pizza 'get cold', so that it cools. How would I do this such that they share the same methods?




  [1]: http://stackoverflow.com/a/1953567/1075247
  [2]: http://en.wikipedia.org/wiki/Builder_pattern