ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: Parameterised constructors
Date Thu, 21 Sep 2006 14:05:23 GMT
Nope, it just works.  Note the security post by Niels earlier.

-- Remember, we understand this isn't ideal.  But it's better than public
setters!

Cheers,
Clinton

On 9/19/06, Ray_Offiah@waitrose.co.uk <Ray_Offiah@waitrose.co.uk> wrote:
>
> It'll raise a few eyebrows but I'll see what the chaps say.
>
> Is there any documentation anywhere on using private setters? Do I need to
> add something to the result map entries, and will I need to fiddle with
> the
> JVM security manager?
>
>
>
> |---------+--------------------------->
> |         |           "Clinton Begin" |
> |         |           <clinton.begin@g|
> |         |           mail.com>       |
> |         |                           |
> |         |           19/09/2006 15:11|
> |         |           Please respond  |
> |         |           to user-java    |
> |         |                           |
> |---------+--------------------------->
>
>   >---------------------------------------------------------------------------------------------------------------|
>   |
> |
>   |        To:      user-java@ibatis.apache.org
> |
>   |        cc:      (bcc: Ray
> Offiah/WRSYS/MANSERV/JLP)
> |
>   |        Subject: Re: Parameterised
> constructors                                                                |
>
>   >---------------------------------------------------------------------------------------------------------------|
>
>
>
>
>
> I understand that you're using constructor injection and that they don't
> have setters.
>
> What I'm suggesting is that you add private setters and a parameterless
> constructor.  It won't have any impact on the immutability of your class.
>
> It's a bit of extra code, but not uncommon.  I know it's not ideal, but it
> would work for the time being.
>
> Cheers,
> Clinton
>
>
> On 9/19/06, Ray_Offiah@waitrose.co.uk <Ray_Offiah@waitrose.co.uk> wrote:
> The private setters is a nice addition, but not really helpful in our
> situation because the fields actually don't have setters at all; the
> object
> is filled in through the constructor call.
>
> I did pick up on some interesting conversations that you had with the the
> guy who wrote O/R Broker, which seems to have a nice pattern for dealing
> with constructors and complex loading statements (like loading up a field
> based on the contents of another field). Hopefully we'll see something
> similar in IBatis in the future.
>
> Thanks for your help ... :-)
>
>
>
> |---------+--------------------------->
> |         |           "Clinton Begin" |
> |         |           <clinton.begin@g |
> |         |           mail.com>       |
> |         |                           |
> |         |           18/09/2006 20:22|
> |         |           Please respond  |
> |         |           to user-java    |
> |         |                           |
> |---------+--------------------------->
>
>
> >---------------------------------------------------------------------------------------------------------------|
>
>   |
> |
>   |        To:      user-java@ibatis.apache.org
> |
>   |        cc:      (bcc: Ray Offiah/WRSYS/MANSERV/JLP)
> |
>   |        Subject: Re: Parameterised constructors
> |
>
>
> >---------------------------------------------------------------------------------------------------------------|
>
>
>
>
>
> As a temporary alternative we do support private setters as of 2.2.0.
>
> Constructor injection is supported in the .NET version.  The two codebases
> are somewhat similar, so we could always check on their approach to it.
>
> Clinton
>
> On 9/18/06, Jeff Butler <jeffgbutler@gmail.com> wrote:
> I remember some folks asking about this, but no commitment to do it.  It
> would require quite a change to the way iBATIS processes result sets.
> Translation: don't expect this anytime soon.
>
> BTW, the Sun patterns web site has some information about an immutable
> transfer object pattern here:
>
> http://java.sun.com/blueprints/patterns/TransferObject.html
>
> The basic idea is that you create an interface for the immutable part, and
> a mutable static inner class for initializing.  This does work with
> iBATIS.
>
> But one warning - we used this pattern on my team for a while and everyone
> (me included) HATED it.  So we eventually went to simple JavaBeans with
> getters AND setters.
>
> Jeff Butler
>
>
> On 9/18/06, Ray_Offiah@waitrose.co.uk < Ray_Offiah@waitrose.co.uk > wrote:
> Mmm ... no that's not quite it.
>
> I have a set of VO classes that are immutable. This means that all the
> data
>
>
> is added at construction.
>
>
>
> |---------+--------------------------->
> |         |           "Larry Meadors" |
> |         |           <lmeadors@apache|
> |         |           .org>           |
> |         |           Sent by:        |
> |         |           larry.meadors@gm|
> |         |           ail.com          |
> |         |                           |
> |         |                           |
> |         |           18/09/2006 13:10|
> |         |           Please respond  |
> |         |           to user-java    |
> |         |                           |
> |---------+--------------------------->
>
> >---------------------------------------------------------------------------------------------------------------|
>
>
> |
> |
> |        To:      user-java@ibatis.apache.org
> |
> |        cc:      (bcc: Ray Offiah/WRSYS/MANSERV/JLP)
> |
> |        Subject: Re: Parameterised constructors
> |
>
> >---------------------------------------------------------------------------------------------------------------|
>
>
>
>
>
>
>
> I am not finding docs for it at the moment, either. I think that the
> ResultObjectFactoryTest unit test does what you want. Take a look, and
> see - if it is, please feel free to add a page to the WIKI
> (http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home )
> on how to use it.
>
> Larry
>
>
> On 9/18/06, Ray_Offiah@waitrose.co.uk < Ray_Offiah@waitrose.co.uk> wrote:
> >
> > Hi there!
> >
> > I vaguely remember reading that parameterised constructors were being
> > considered for Ibatis. Is this still planned for a future release, or
> has
>
> > the idea been dropped?
> >
> > I noticed that there was no mention of them in the documentation for the
> > latest beta, which is a bit of a shame (for me anyway; not sure how many
> > others would find them useful)
> >
> >
> >
> > **********************************************************************
> > This email is confidential and may contain copyright material of the
> John
>
>
> Lewis Partnership. If you are not the intended recipient, please notify us
> immediately and delete all copies of this message. (Please note that it is
> your responsibility to scan this message for viruses). Email to and from
> the John Lewis Partnership is automatically monitored for operational and
> lawful business reasons.
> > **********************************************************************
> > John Lewis plc
> > Registered in England 233462
> > Registered office  171 Victoria Street London SW1E 5NN
> >
> > Websites: http://www.johnlewis.com
> > http://www.waitrose.com
> > http://www.johnlewispartnership.co.uk
> >
> > **********************************************************************
> >
> >
>
>
>
>
> **********************************************************************
> This email is confidential and may contain copyright material of the John
> Lewis Partnership. If you are not the intended recipient, please notify us
> immediately and delete all copies of this message. (Please note that it is
> your responsibility to scan this message for viruses). Email to and from
> the John Lewis Partnership is automatically monitored for operational and
> lawful business reasons.
> **********************************************************************
> John Lewis plc
> Registered in England 233462
> Registered office  171 Victoria Street London SW1E 5NN
>
> Websites: http://www.johnlewis.com
> http://www.waitrose.com
> http://www.johnlewispartnership.co.uk
>
> **********************************************************************
>
>
>
>
>
>
> **********************************************************************
> This email is confidential and may contain copyright material of the John
> Lewis Partnership. If you are not the intended recipient, please notify us
> immediately and delete all copies of this message. (Please note that it is
> your responsibility to scan this message for viruses). Email to and from
> the John Lewis Partnership is automatically monitored for operational and
> lawful business reasons.
> **********************************************************************
> John Lewis plc
> Registered in England 233462
> Registered office  171 Victoria Street London SW1E 5NN
>
> Websites: http://www.johnlewis.com
> http://www.waitrose.com
> http://www.johnlewispartnership.co.uk
>
> **********************************************************************
>
>
>
>
>
> **********************************************************************
> This email is confidential and may contain copyright material of the John
> Lewis Partnership. If you are not the intended recipient, please notify us
> immediately and delete all copies of this message. (Please note that it is
> your responsibility to scan this message for viruses). Email to and from the
> John Lewis Partnership is automatically monitored for operational and lawful
> business reasons.
> **********************************************************************
> John Lewis plc
> Registered in England 233462
> Registered office  171 Victoria Street London SW1E 5NN
>
> Websites: http://www.johnlewis.com
> http://www.waitrose.com
> http://www.johnlewispartnership.co.uk
>
> **********************************************************************
>
>

Mime
View raw message