Tag Archives: boiler_plate

Build beans better with builders

Builders provide a nice, if verbose, way to create immutable java beans.

The upsides are a nice syntax for creating immutable beans, and a way to provide copy-on-write behaviour for immutable objects.

The downsides are the need for verbose boilerplate code, approximately doubling the code size of the bean source files, and the overhead of one extra object created and then left for garbage collection, for each created bean.

Continue reading Build beans better with builders