cxxr / better-java

Resources for writing modern Java
Other
5.79k stars 730 forks source link

Add a section about generating immutable objects #28

Closed arteam closed 8 years ago

arteam commented 8 years ago

This change adds a section about considering to use the annotation processors to generate immutable objects.

Immutable objects have many advantages, but it's very easy to make a mistake during writing one, especially if the object's definition is often changed. There are a couple of libraries that solve this problem by generating immutable objects from interfaces and annotations.

In my opinion, it's a quite modern way to use immutable objects, which makes its development more easy and faster.

cxxr commented 8 years ago

Great idea, thanks!