You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Ling Wang <li...@yahoo.com> on 2005/09/08 20:21:46 UTC

Support for mapping of public fields.

Ted,

I like your book (struts in action). Glad to see you
active in iBATIS for .Net. I recently posted a message
saying it would be nice if iBATIS can support mapping
of public fields besides properties (getters and
setters). Do you know if that is already on the to do
list? If yes, any idea when will it be implemented?

Thanks.

Ling


Re: Support for mapping of public fields.

Posted by Gilles Bayon <ib...@gmail.com>.
It's not planned in the near futur.
And as this addition is subject to discussion (not best practice), it's not 
sure we support it.
 -Gilles 
 On 9/8/05, Ling Wang <li...@yahoo.com> wrote: 
> 
> Ted,
> 
> I like your book (struts in action). Glad to see you
> active in iBATIS for .Net. I recently posted a message
> saying it would be nice if iBATIS can support mapping
> of public fields besides properties (getters and
> setters). Do you know if that is already on the to do
> list? If yes, any idea when will it be implemented?
> 
> Thanks.
> 
> Ling
> 
>

Re: Support for mapping of public fields.

Posted by Ted Husted <te...@gmail.com>.
As a rule, the best way to get a feature implemented in an open source
project is to try writing the patch yourself. Others can then try the
patch before deciding.

When I first started using iBATIS.Net, I tried populating public
fields myself. Given the way properties are implemented in C#, it does
seem like a likely feature, since you can switch from a  field to a
property without making other changes in your code. If a line reads

Something = "Test";

Something could be a field or it could be a property. The caller
neither knows nor cares, and the definer can change Something from one
form to other without breaking the API.

Of course, sight unseen, there's no guarantee that the patch would be
applied to the main distribution, but it would be there for yourself
and others to use.

-- HTH, Ted.
http://www.husted.com/poe/

On 9/8/05, Ling Wang <li...@yahoo.com> wrote:
> Ted,
> 
> I like your book (struts in action). Glad to see you
> active in iBATIS for .Net. I recently posted a message
> saying it would be nice if iBATIS can support mapping
> of public fields besides properties (getters and
> setters). Do you know if that is already on the to do
> list? If yes, any idea when will it be implemented?
> 
> Thanks.
> 
> Ling