I agree you can write ugly code this way, but since its an API for others to
use, I'm not trying to make that kind of judgement, just make it possible
for others to code in that style if they want.

I will note that I did find it very helpful when having to invoke super() in
a constructor, or setting just one argument on the object as a function
parameter and then throwing it away.

On Thu, Apr 16, 2009 at 3:48 PM, Isaac Truett <[email protected]> wrote:

>
> Personally I don't care for this style of coding. I think it's very
> convenient for writing, but it hurts readability.
>
>
> On Thu, Apr 16, 2009 at 2:03 PM, Eric Ayers <[email protected]> wrote:
> > Recently I've been wrapping some of my JavaScriptObjects using the
> builder
> > pattern where an instance of the object you are setting is in the return
> > value.
> >
> >   http://galgwt-reviews.appspot.com/21604/diff/1/18?context=10
> >
> > Which you would invoke as:
> >
> >
> >   DraggableObject obj = new DraggableObject(elem,
> > DraggableObjectOptions.newInstance().setLeft(10).setTop(5));
> >
> > Can anyone think of a reason I might be shooting myself in the foot
> > performance wise or code size wise as opposed to making these strict
> setter
> > methods?  I don't want to set a bad example.
> >
> > -Eric.
> > --
> > Eric Z. Ayers - GWT Team - Atlanta, GA USA
> > http://code.google.com/webtoolkit/
> >
> > >
> >
>
> >
>


-- 
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to