You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Mathias Herberts <ma...@gmail.com> on 2010/03/30 23:20:55 UTC

Re: [jira] Updated: (THRIFT-663) JavaBean code generator produces incorrect setter methods

On Tue, Mar 30, 2010 at 23:10, Bryan Duxbury (JIRA) <ji...@apache.org> wrote:
>
>     [ https://issues.apache.org/jira/browse/THRIFT-663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Bryan Duxbury updated THRIFT-663:
> ---------------------------------
>
>    Attachment: thrift-663.patch
>
> OK, how about this?
>
> The "beans" option will make sure the setter methods return void.
>
> The "private-members" option leaves the setter methods alone, but makes sure the actual members are private. This is for those of us who want the builder style setters but private instance variables.

Why not come out all the way and have a 'builder' option which would
create a Builder class which would do something similar as what J.
Bloch describes in Effective Java (@see
http://rwhansen.blogspot.com/2007/07/theres-builder-pattern-that-joshua.html)?

Re: [jira] Updated: (THRIFT-663) JavaBean code generator produces incorrect setter methods

Posted by Bryan Duxbury <br...@rapleaf.com>.
I'd be willing to explore this option. This is just a more incremental
approach, I'd say.

On Tue, Mar 30, 2010 at 2:20 PM, Mathias Herberts <
mathias.herberts@gmail.com> wrote:

> On Tue, Mar 30, 2010 at 23:10, Bryan Duxbury (JIRA) <ji...@apache.org>
> wrote:
> >
> >     [
> https://issues.apache.org/jira/browse/THRIFT-663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
> >
> > Bryan Duxbury updated THRIFT-663:
> > ---------------------------------
> >
> >    Attachment: thrift-663.patch
> >
> > OK, how about this?
> >
> > The "beans" option will make sure the setter methods return void.
> >
> > The "private-members" option leaves the setter methods alone, but makes
> sure the actual members are private. This is for those of us who want the
> builder style setters but private instance variables.
>
> Why not come out all the way and have a 'builder' option which would
> create a Builder class which would do something similar as what J.
> Bloch describes in Effective Java (@see
>
> http://rwhansen.blogspot.com/2007/07/theres-builder-pattern-that-joshua.html
> )?
>