What is the best practice for using Builder pattern in \"deep\" object hierarchies? To elaborate, I explored the idea of applying the Builder pattern as proposed by Joshua Bloch
If you generate code from an XML schema with JAXB, the "fluent-builder" plugin from jaxb2-rich-contract-plugin will help you. It generates a deep builder pattern where you can chain builders together, and use an "end()" method to finish building a nested object and return to the builder context of its parent. However, writing this by hand for a given Java class seems a bit tedious...