ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doroszlai, Attila" <adorosz...@apache.org>
Subject Re: IDE setup required on branch-feature-AMBARI-14714
Date Thu, 01 Mar 2018 21:43:36 GMT
Jonathan,

Your concern is valid, however please consider:

 * The way FreeBuilder is invoked by Maven/Eclipse/IDEA is not a
custom plugin.  Annotation processing is a standard part of the Java
compiler.  Eclipse or IntelliJ cannot simply stop supporting it.
https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javac.html#sthref63

 * We do have the code generated by FreeBuilder.  Ambari can decide at
any time to stop using FreeBuilder, and keep the code generated so
far.  https://github.com/inferred/FreeBuilder#wait-why-free (3rd item)

 * Ambari depends way deeper on Guice for example, which is also a
3rd-party library.  Yes, maybe the code would compile after removing
all the Guice-specific code, but it would not work without manually
passing all the instances that are now injected.


Nate,

By boilerplate I mean:

 * proper equals/hashCode/toString implementations for simple data
objects (eg. *Request classes in Ambari) http://bit.ly/2GXatWH
 * code duplication when you want almost identical instances eg. for
unit tests http://bit.ly/2oMCzNg
 * unnecessary code when you don't need all properties of some object
for the test, but have to specify them anyway http://bit.ly/2FJpQ5X
 * unless you create chained constructors for the previous case
http://bit.ly/2ozNWbJ

All these cases can be implemented more easily, in more readable and
less fragile ways using FreeBuilder (and some other similar
frameworks).


-Attila

Mime
View raw message