Hi Guy,

Lombok was quite the hype a few years ago from what I remember, and perhaps
it "inspired" a number of projects one could consider derived from it.
Meanwhile I think there are perhaps better alternatives for it's different
features. Most that I've looked at in this kind of space is now more
"standard" javac annotation processors based (APT API; from what I
understood, Lombok at least initially at its time wasn't, and uses some
"tricks" to hook into compilation to augment bytecode; AFAIK it doesn't
actually gen. *.java src like APT does; which makes at least me always feel
a bit... you know).

FYI For a light-weight getters/builders/hashCode/equals, I personally think
http://immutables.github.io is quite interesting & useful.. so far I have
explored using it in a few tests in ODL, and quite liked it.

BTW re. javac APT, FYI I'm bundling https://github.com/jbosstools/m2e-apt
in https://github.com/vorburger/opendaylight-eclipse-setup, so e.g.
Immutables (and other APT procs), work out of the box, mostly.. ;-)

Related, there is also Google's Auto Value (
https://github.com/google/auto/blob/master/value/userguide/index.md) along
very similar lines; having looked into both, I happen to prefer
Immutables.org due to some things I believe they've done better; but at a
higher level, they're relatively similar.

As for Lombok's @NonNull feature, I would argue that tool supported real
null analysis already during development time instead of (only) runtime
checks is the proper way forward. FYI I've done some work to evaluate this,
and just last week presented some first findings at a conference; see my
slides on
http://www.slideshare.net/mikervorburger/the-end-of-the-world-as-we-know-it-aka-your-last-nullpointerexception-1b-bugs
for an impression. I'm hoping to be able to make the time to gradually
propose this into ODL in the coming weeks; incl. e.g. with
https://git.opendaylight.org/gerrit/#/c/47359/ (about to be merged) and
https://git.opendaylight.org/gerrit/#/c/47370/ (still WIP) and more based
on this.

Tx,
M.
--
Michael Vorburger <vorbur...@redhat.com> | IRC: vorburger @freenode | ~ =
http://vorburger.ch



On Fri, Oct 14, 2016 at 11:23 AM, Sela, Guy <guy.s...@hpe.com> wrote:

> Thanks.
>
> -----Original Message-----
> From: Robert Varga [mailto:n...@hq.sk]
> Sent: Friday, October 14, 2016 12:15 PM
> To: Sela, Guy <guy.s...@hpe.com>; controller-dev@lists.opendaylight.org;
> d...@lists.opendaylight.org
> Subject: Re: [opendaylight-dev] Lombok
>
>
>
> On 10/13/2016 10:13 PM, Sela, Guy wrote:
> > Hi,
> >
> > Did anyone consider adding Lombok into ODL?
> >
> > https://projectlombok.org/features/
> >
> > https://gualtierotesta.wordpress.com/2014/03/03/tutorial-using-lombok-
> > to-reduce-boilerplate-code-in-java/
>
> Not seriously, no. There are three main reasons:
>
> 1) for inter-component interactions we use YANG and hence have an
> equivalent for getters/builders/hashCode/equals
>
> 2) concerns about code readability and learning curve for newcomers
>
> 3) it makes performance trade-offs without giving sufficient control.
> For example https://projectlombok.org/features/GetterLazy.html -- that
> AtomicReference is used only as a lock, wasting 16-24 bytes of memory for
> each such field.
>
> Overall it does not look like a mature enough project for the code we have
> evaluated it for (yangtools, mdsal, bgpcep).
>
> Regards,
> Robert
>
> _______________________________________________
> dev mailing list
> d...@lists.opendaylight.org
> https://lists.opendaylight.org/mailman/listinfo/dev
>
_______________________________________________
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev

Reply via email to