TL;DR For sake of discussion, there's less magical codegen available: write
source. Probably not a silver bullet either.

Tools like Dagger, Wire, and Google Auto generate readable source code.
Also the test infra for how these work internally is getting super robust.

https://github.com/google/auto/blob/master/factory/src/test/java/com/google/auto/factory/processor/AutoFactoryProcessorTest.java

There are pitfalls to any annotation processing, most notably fragile IDE
setup which is hard to setup correctly (even with gradle :) ).  Also, round
tripping or last mile stuff can be problematic.  Basically they work best
when they do exactly what you want.

Jclouds supports some pretty varied styles in writing domain classes, from
"mind bending generic builder subclasses" to simple no-builder final
ctors.  In a project that didnt need to support inheritance or extension,
maybe moving to black-box code gen might be safe.  As it is, we have so
many dialects pf both style (ex. How to write equals) and apis pinned to
(the 3 ways keystone is implemented), I've my doubts.

Nice discussion!
 On Nov 11, 2013 10:36 AM, "Jeremy Daggett" <jeremy.dagg...@gmail.com>
wrote:

> Hi devs,
>
> Has anyone in the community ever looked at using Project Lombok[1] to help
> simplify our source code?  I stumbled across this a couple of years back
> and thought it was pretty useful. Just never had a chance to use it with
> anything...
>
> I think that the @Builder [2], @EqualsHashCode, and other annotations could
> make many of our classes much simpler. We might be able to get rid of all
> of that boilerplate code! ;)
>
> WDYT?
>
> [1] http://projectlombok.org/
> [2]
>
> https://github.com/rzwitserloot/lombok/blob/master/src/core/lombok/experimental/Builder.java
>
> /jd
>

Reply via email to