If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Friday, February 28, 2014

Java, Immutability and Builders

When you have to work with complex nested object structures and you want an easy way to create them and test them, I think it's definitely worthwhile to create a builder. A builder is a fluent DSL to create (domain) objects. Below you can see how that works out

1 comment:

  1. A builder pattern doesn't have to implement a fluent interface, but they do go very nice together.
    It might be interesting to note that there are tools to automatically generate your fluent builders, such as this nice eclipse plugin, so you don't have to write out a whole bunch of samey code.