[Building Sakai] Java Help - Builder Pattern and Setters

Steve Swinsburg steve.swinsburg at gmail.com
Tue Aug 13 05:42:29 PDT 2013


This is not a new thing, its been around the Sakai code base since 2008 and
everyone is using it in production already. If you have an issue with it
then by all means lets discuss it (in a new thread), but it does make code
a hell of a lot easier to read and manage. Sure, Eclipse can insert getters
and setters and various other methods, but you still need to trawl through
them all and they aren't automatically updated. Plus lombok does a lot more
than just getters and setters.

There is no extra maven build required except a dependency entry. The
annotations are expanded at compile time and discarded leaving no
additional footprint on any deployed code (with the exception of one or two
runtime annotations which I don't think are even used but I mentioned it
for completeness).

cheers,
S




On Tue, Aug 13, 2013 at 10:34 PM, Aaron Zeckoski <azeckoski at unicon.net>wrote:

> We should probably discuss this before we start cramming in this
> everywhere in Sakai. I actually am strongly against this and have seen
> multiple new developers to Sakai confused by it. I get that using
> eclipse to generated getters takes a few clicks and makes the code a
> little longer... but is it really so hard to do? Sure this saves a few
> lines of code but at the expense of requiring special eclipse (or
> other IDE) configuration and extra maven build and special dev
> knowledge of what is happening (so they know why they don't see any
> get and set methods like... 99% of java projects. It also completely
> breaks compile time code scanning (around anything it inserts) but
> that is a lesser concern.
>
> I am not sold on it and I would prefer this be discussed as a group
> before we start inserting it throughout the Sakai codebase (like any
> new tech that we are adding in).
>
> If we are going to start requiring this then those who support it need
> to make an effort to clearly document the requirement in the release
> notes, confluence, and in the code so it is clear that this is being
> used and is now required in order to build Sakai.
> -AZ
>
>
> On Tue, Aug 13, 2013 at 8:23 AM, Steve Swinsburg
> <steve.swinsburg at gmail.com> wrote:
> > It is too easy. Its built for people who love sexy code. You love sexy
> code,
> > right? I have already polluted (read: made sexy) a good chunk of Sakai
> with
> > it ;)
> >
> >
> > On Tue, Aug 13, 2013 at 10:11 PM, Charles Severance <csev at umich.edu>
> wrote:
> >>
> >>
> >> On Aug 12, 2013, at 11:19 PM, Steve Swinsburg <
> steve.swinsburg at gmail.com>
> >> wrote:
> >>
> >> Hi Chuck,
> >>
> >> I'd encourage you to look at the Lombok annotations to make the code
> >> neater (ie eliminating all getters and setters). Specifically for this
> >> pattern you may be able to use:
> >> http://projectlombok.org/features/experimental/Builder.html
> >>
> >> There is a video on the lombok site that might twist your arm as to its
> >> appeal.
> >>
> >> cheers,
> >> Steve
> >>
> >>
> >> I have watched that video many times with interest.  I love Lombok - but
> >> don't exactly know why I am not ready to go to the dark side in my own
> code.
> >> It seems so powerful.  It seems too easy :)
> >>
> >> /Chuck
> >>
> >
> >
> > _______________________________________________
> > sakai-dev mailing list
> > sakai-dev at collab.sakaiproject.org
> > http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> >
> > TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org
> > with a subject of "unsubscribe"
>
>
>
> --
> Aaron Zeckoski - Software Architect - http://tinyurl.com/azprofile
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130813/ffb0083c/attachment.html 


More information about the sakai-dev mailing list