You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by Clinton Begin <cl...@gmail.com> on 2007/02/09 08:44:49 UTC
Direct-to-Field mappings now implemented.
Hi all,
I found a few hours tonight to implement direct-to-field mappings. I
don't have any energy left to explain it fully, but it's simple to
use, so here's the summary.
To implement this, I changed the ClassInfo to accept a new pattern of
"property" access. You can now wrap a field names in round brackets
to distinguish them from properties. So:
"id" is a property.
"(id)" is a field.
These can be mixed with properties like:
"account.(address).street"
This last point is important and is the primary reason I didn't use a
new XML tag -- that would have severely limited the mix-n-match
ability of the feature (and it would have been harder to implement).
This approach works for reads and writes and for both inline or
external parameter maps and result maps.
It should be ubiquitous. Anywhere you used to use property names, you
can now use (field) names too.
Thoughts? It's not too late to change the syntax (round brackets) or
anything else.
I think it's the simplest, most flexible and performant approach.
Cheers,
Clinton
Re: Direct-to-Field mappings now implemented.
Posted by Brandon Goodin <br...@gmail.com>.
okay
On 2/11/07, Clinton Begin <cl...@gmail.com> wrote:
>
> Yes, you're absolutely right about that. Constructor injection is our
> goal going forward. It's quite a bit harder to implement than direct
> field mapping, but I would like to see it. I may look into it next
> week.
>
> Direct field is still important though, for people that don't buy into
> constructor injection (why? I dunno!). ;-)
>
> Clinton
>
> On 2/11/07, Brandon Goodin <br...@gmail.com> wrote:
> > Isn't that what constructors are for?
> >
> >
> > On 2/11/07, Clinton Begin <cl...@gmail.com> wrote:
> > > Absolutely not. :-)
> > >
> > > Direct field mapping for the purposes of immutable classes or non-bean
> > > types would be pointless. So yes, we're completely ignoring private
> > > on fields, setters, and constructors.
> > >
> > > I don't see a problem with it...it's how it's done. We won't break
> > > getter/setter encapsulation, because if the methods exists, we use
> > > them.
> > >
> > > Believe it or not, doing this allows people to build safer
> > > applications. JavaBeans are the real threat to encapsulation. They
> > > force us to have public mutators and a default constructor, both of
> > > which can result in a class ending up in an inconsistent state.
> > >
> > > So yes. Our framework (like many) ignores access modifiers so that
> > > programmers can actually USE access modifiers effectively.
> > >
> > > How ironic. ;-)
> > >
> > > Clinton
> > >
> > > On 2/10/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > Just curious. Are we still honoring access privileges on fields or
> are
> > we
> > > > doing an end around on them and setting regardless? I'm hoping we
> still
> > > > honor public, package, protected, private. Otherwise that can get
> > > > unpredictable.
> > > >
> > > > Brandon
> > > >
> > > > On 2/10/07, Paul Benedict < pbenedict@apache.org> wrote:
> > > > > Very well. In fact, the fallback to fields may turn out to be
> > > > > advantageous. Let's see how it goes, as you said, and listen to
> the
> > > > > feedback. Thanks Clinton!
> > > > >
> > > > > Clinton Begin wrote:
> > > > > > I think we need a stronger argument for a switch than "I might
> shoot
> > > > > > myself in the foot". :-)
> > > > > >
> > > > > > It's pretty simple to force methods to be called (write them)
> and to
> > > > > > avoid fields from being loaded in odd cases (don't include them
> in
> > the
> > > > > > select clause).
> > > > > >
> > > > > > Let's give it some time the way it is, and if many people start
> > > > > > finding unexpected results due to field mappings, then let's add
> a
> > > > > > switch at that time.
> > > > > >
> > > > > > Cheers,
> > > > > > Clinton
> > > > >
> > > >
> > > >
> > >
> >
> >
>
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
Yes, you're absolutely right about that. Constructor injection is our
goal going forward. It's quite a bit harder to implement than direct
field mapping, but I would like to see it. I may look into it next
week.
Direct field is still important though, for people that don't buy into
constructor injection (why? I dunno!). ;-)
Clinton
On 2/11/07, Brandon Goodin <br...@gmail.com> wrote:
> Isn't that what constructors are for?
>
>
> On 2/11/07, Clinton Begin <cl...@gmail.com> wrote:
> > Absolutely not. :-)
> >
> > Direct field mapping for the purposes of immutable classes or non-bean
> > types would be pointless. So yes, we're completely ignoring private
> > on fields, setters, and constructors.
> >
> > I don't see a problem with it...it's how it's done. We won't break
> > getter/setter encapsulation, because if the methods exists, we use
> > them.
> >
> > Believe it or not, doing this allows people to build safer
> > applications. JavaBeans are the real threat to encapsulation. They
> > force us to have public mutators and a default constructor, both of
> > which can result in a class ending up in an inconsistent state.
> >
> > So yes. Our framework (like many) ignores access modifiers so that
> > programmers can actually USE access modifiers effectively.
> >
> > How ironic. ;-)
> >
> > Clinton
> >
> > On 2/10/07, Brandon Goodin <br...@gmail.com> wrote:
> > > Just curious. Are we still honoring access privileges on fields or are
> we
> > > doing an end around on them and setting regardless? I'm hoping we still
> > > honor public, package, protected, private. Otherwise that can get
> > > unpredictable.
> > >
> > > Brandon
> > >
> > > On 2/10/07, Paul Benedict < pbenedict@apache.org> wrote:
> > > > Very well. In fact, the fallback to fields may turn out to be
> > > > advantageous. Let's see how it goes, as you said, and listen to the
> > > > feedback. Thanks Clinton!
> > > >
> > > > Clinton Begin wrote:
> > > > > I think we need a stronger argument for a switch than "I might shoot
> > > > > myself in the foot". :-)
> > > > >
> > > > > It's pretty simple to force methods to be called (write them) and to
> > > > > avoid fields from being loaded in odd cases (don't include them in
> the
> > > > > select clause).
> > > > >
> > > > > Let's give it some time the way it is, and if many people start
> > > > > finding unexpected results due to field mappings, then let's add a
> > > > > switch at that time.
> > > > >
> > > > > Cheers,
> > > > > Clinton
> > > >
> > >
> > >
> >
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Brandon Goodin <br...@gmail.com>.
Isn't that what constructors are for?
On 2/11/07, Clinton Begin <cl...@gmail.com> wrote:
>
> Absolutely not. :-)
>
> Direct field mapping for the purposes of immutable classes or non-bean
> types would be pointless. So yes, we're completely ignoring private
> on fields, setters, and constructors.
>
> I don't see a problem with it...it's how it's done. We won't break
> getter/setter encapsulation, because if the methods exists, we use
> them.
>
> Believe it or not, doing this allows people to build safer
> applications. JavaBeans are the real threat to encapsulation. They
> force us to have public mutators and a default constructor, both of
> which can result in a class ending up in an inconsistent state.
>
> So yes. Our framework (like many) ignores access modifiers so that
> programmers can actually USE access modifiers effectively.
>
> How ironic. ;-)
>
> Clinton
>
> On 2/10/07, Brandon Goodin <br...@gmail.com> wrote:
> > Just curious. Are we still honoring access privileges on fields or are
> we
> > doing an end around on them and setting regardless? I'm hoping we still
> > honor public, package, protected, private. Otherwise that can get
> > unpredictable.
> >
> > Brandon
> >
> > On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
> > > Very well. In fact, the fallback to fields may turn out to be
> > > advantageous. Let's see how it goes, as you said, and listen to the
> > > feedback. Thanks Clinton!
> > >
> > > Clinton Begin wrote:
> > > > I think we need a stronger argument for a switch than "I might shoot
> > > > myself in the foot". :-)
> > > >
> > > > It's pretty simple to force methods to be called (write them) and to
> > > > avoid fields from being loaded in odd cases (don't include them in
> the
> > > > select clause).
> > > >
> > > > Let's give it some time the way it is, and if many people start
> > > > finding unexpected results due to field mappings, then let's add a
> > > > switch at that time.
> > > >
> > > > Cheers,
> > > > Clinton
> > >
> >
> >
>
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
Absolutely not. :-)
Direct field mapping for the purposes of immutable classes or non-bean
types would be pointless. So yes, we're completely ignoring private
on fields, setters, and constructors.
I don't see a problem with it...it's how it's done. We won't break
getter/setter encapsulation, because if the methods exists, we use
them.
Believe it or not, doing this allows people to build safer
applications. JavaBeans are the real threat to encapsulation. They
force us to have public mutators and a default constructor, both of
which can result in a class ending up in an inconsistent state.
So yes. Our framework (like many) ignores access modifiers so that
programmers can actually USE access modifiers effectively.
How ironic. ;-)
Clinton
On 2/10/07, Brandon Goodin <br...@gmail.com> wrote:
> Just curious. Are we still honoring access privileges on fields or are we
> doing an end around on them and setting regardless? I'm hoping we still
> honor public, package, protected, private. Otherwise that can get
> unpredictable.
>
> Brandon
>
> On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
> > Very well. In fact, the fallback to fields may turn out to be
> > advantageous. Let's see how it goes, as you said, and listen to the
> > feedback. Thanks Clinton!
> >
> > Clinton Begin wrote:
> > > I think we need a stronger argument for a switch than "I might shoot
> > > myself in the foot". :-)
> > >
> > > It's pretty simple to force methods to be called (write them) and to
> > > avoid fields from being loaded in odd cases (don't include them in the
> > > select clause).
> > >
> > > Let's give it some time the way it is, and if many people start
> > > finding unexpected results due to field mappings, then let's add a
> > > switch at that time.
> > >
> > > Cheers,
> > > Clinton
> >
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Brandon Goodin <br...@gmail.com>.
Just curious. Are we still honoring access privileges on fields or are we
doing an end around on them and setting regardless? I'm hoping we still
honor public, package, protected, private. Otherwise that can get
unpredictable.
Brandon
On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
>
> Very well. In fact, the fallback to fields may turn out to be
> advantageous. Let's see how it goes, as you said, and listen to the
> feedback. Thanks Clinton!
>
> Clinton Begin wrote:
> > I think we need a stronger argument for a switch than "I might shoot
> > myself in the foot". :-)
> >
> > It's pretty simple to force methods to be called (write them) and to
> > avoid fields from being loaded in odd cases (don't include them in the
> > select clause).
> >
> > Let's give it some time the way it is, and if many people start
> > finding unexpected results due to field mappings, then let's add a
> > switch at that time.
> >
> > Cheers,
> > Clinton
>
Re: Direct-to-Field mappings now implemented.
Posted by Paul Benedict <pb...@apache.org>.
Very well. In fact, the fallback to fields may turn out to be
advantageous. Let's see how it goes, as you said, and listen to the
feedback. Thanks Clinton!
Clinton Begin wrote:
> I think we need a stronger argument for a switch than "I might shoot
> myself in the foot". :-)
>
> It's pretty simple to force methods to be called (write them) and to
> avoid fields from being loaded in odd cases (don't include them in the
> select clause).
>
> Let's give it some time the way it is, and if many people start
> finding unexpected results due to field mappings, then let's add a
> switch at that time.
>
> Cheers,
> Clinton
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
I think we need a stronger argument for a switch than "I might shoot
myself in the foot". :-)
It's pretty simple to force methods to be called (write them) and to
avoid fields from being loaded in odd cases (don't include them in the
select clause).
Let's give it some time the way it is, and if many people start
finding unexpected results due to field mappings, then let's add a
switch at that time.
Cheers,
Clinton
On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
> How can I argue with that advice? :-) However, I am a man of many errors
> and I will not be able to use unit tests to find these problems anymore
> unless there is a way for iBatis to tell me I forgot my methods. I
> really really don't want direct-field access to bite my designs. It
> might just be too easy for bugs to get by unless the tool is smarter.
>
> Paul
>
> Clinton Begin wrote:
> > So far, there's no switch to turn it on or off.
> >
> > I guess I'm thinking if you want to enforce that it go through
> > methods, then write the methods. :-)
> >
> > Clinton
> >
> > On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
> >> Clinton,
> >>
> >> That's awesome! Good job!
> >>
> >> May I ask if this field-setter access is something I need to turn on or
> >> off? I hope so. I want to enforce my usage to go through methods.
> >>
> >> Paul
> >>
> >> Clinton Begin wrote:
> >> > Okay...
> >> >
> >> > I've made the change. It now uses fields only if a get or set method
> >> > doesn't exist. Of course, the decision is independent for get and
> >> > set, so if a set doesn't exist, but a get does, it will use the field
> >> > for setting, but the getter for getting. I've also enabled private
> >> > constructor access.
> >> >
> >> > Basically this means, iBATIS now works with POJOs for real... we don't
> >> > depend on the JavaBeans spec at all really. You can use your own
> >> > property syntax and private default constructors with parameterized
> >> > constructors for programmatic construction.
> >> >
> >> > Pretty cool stuff really.
> >> >
> >> > Cheers,
> >> > Clinton
> >> >
> >> > On 2/10/07, Clinton Begin <cl...@gmail.com> wrote:
> >> >> > If you
> >> >> > have getters/setters then we'll use them. If not, then we'll use
> >> >> the fields
> >> >> > directly. End of story.
> >> >>
> >> >> This is my preference now.
> >> >>
> >> >> The person that asked me about field mappings that originally got me
> >> >> to work on it last week is of the mind that we should just keep it
> >> >> simple like this. Since that was your gut feeling as well as Paul's,
> >> >> I think we should run with it.
> >> >>
> >> >> I think we're over-thinking the solution now. Let us come down from
> >> >> our ivory tower. :-)
> >> >>
> >> >> Clinton
> >> >>
> >> >> On 2/10/07, Jeff Butler <je...@gmail.com> wrote:
> >> >> > Is there any realistic non-academic use case for bypassing the
> >> >> > getters/setters if they exist? In other words, if you want to
> >> go by
> >> >> plane
> >> >> > then don't rent a car :)
> >> >> >
> >> >> > We really encourage people to keep their POJOs simple. I'd sure
> >> >> hate to see
> >> >> > us encourage wierd or overly complex design just because we can.
> >> >> Maybe we
> >> >> > should bypass all the non-standard syntax and configuration
> >> >> options. If you
> >> >> > have getters/setters then we'll use them. If not, then we'll use
> >> >> the fields
> >> >> > directly. End of story.
> >> >> >
> >> >> > Jeff Butler
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
> >> >> > > OGNL uses property notation syntax which calls getters and
> >> >> setters. As
> >> >> > > for the parenthesis syntax, there is no precedent in the market
> >> >> for such
> >> >> > > a syntax being used to access fields directly. The syntax should
> >> >> be the
> >> >> > > same (I want to navigate to X), with an additional attribute
> >> >> specifying
> >> >> > > how it should be done (take me by plane or car).
> >> >> > >
> >> >> > > Paul
> >> >> > >
> >> >> > >
> >> >> > >
> >> >> >
> >> >>
> >> >
> >>
> >
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Paul Benedict <pb...@apache.org>.
How can I argue with that advice? :-) However, I am a man of many errors
and I will not be able to use unit tests to find these problems anymore
unless there is a way for iBatis to tell me I forgot my methods. I
really really don't want direct-field access to bite my designs. It
might just be too easy for bugs to get by unless the tool is smarter.
Paul
Clinton Begin wrote:
> So far, there's no switch to turn it on or off.
>
> I guess I'm thinking if you want to enforce that it go through
> methods, then write the methods. :-)
>
> Clinton
>
> On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
>> Clinton,
>>
>> That's awesome! Good job!
>>
>> May I ask if this field-setter access is something I need to turn on or
>> off? I hope so. I want to enforce my usage to go through methods.
>>
>> Paul
>>
>> Clinton Begin wrote:
>> > Okay...
>> >
>> > I've made the change. It now uses fields only if a get or set method
>> > doesn't exist. Of course, the decision is independent for get and
>> > set, so if a set doesn't exist, but a get does, it will use the field
>> > for setting, but the getter for getting. I've also enabled private
>> > constructor access.
>> >
>> > Basically this means, iBATIS now works with POJOs for real... we don't
>> > depend on the JavaBeans spec at all really. You can use your own
>> > property syntax and private default constructors with parameterized
>> > constructors for programmatic construction.
>> >
>> > Pretty cool stuff really.
>> >
>> > Cheers,
>> > Clinton
>> >
>> > On 2/10/07, Clinton Begin <cl...@gmail.com> wrote:
>> >> > If you
>> >> > have getters/setters then we'll use them. If not, then we'll use
>> >> the fields
>> >> > directly. End of story.
>> >>
>> >> This is my preference now.
>> >>
>> >> The person that asked me about field mappings that originally got me
>> >> to work on it last week is of the mind that we should just keep it
>> >> simple like this. Since that was your gut feeling as well as Paul's,
>> >> I think we should run with it.
>> >>
>> >> I think we're over-thinking the solution now. Let us come down from
>> >> our ivory tower. :-)
>> >>
>> >> Clinton
>> >>
>> >> On 2/10/07, Jeff Butler <je...@gmail.com> wrote:
>> >> > Is there any realistic non-academic use case for bypassing the
>> >> > getters/setters if they exist? In other words, if you want to
>> go by
>> >> plane
>> >> > then don't rent a car :)
>> >> >
>> >> > We really encourage people to keep their POJOs simple. I'd sure
>> >> hate to see
>> >> > us encourage wierd or overly complex design just because we can.
>> >> Maybe we
>> >> > should bypass all the non-standard syntax and configuration
>> >> options. If you
>> >> > have getters/setters then we'll use them. If not, then we'll use
>> >> the fields
>> >> > directly. End of story.
>> >> >
>> >> > Jeff Butler
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
>> >> > > OGNL uses property notation syntax which calls getters and
>> >> setters. As
>> >> > > for the parenthesis syntax, there is no precedent in the market
>> >> for such
>> >> > > a syntax being used to access fields directly. The syntax should
>> >> be the
>> >> > > same (I want to navigate to X), with an additional attribute
>> >> specifying
>> >> > > how it should be done (take me by plane or car).
>> >> > >
>> >> > > Paul
>> >> > >
>> >> > >
>> >> > >
>> >> >
>> >>
>> >
>>
>
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
So far, there's no switch to turn it on or off.
I guess I'm thinking if you want to enforce that it go through
methods, then write the methods. :-)
Clinton
On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
> Clinton,
>
> That's awesome! Good job!
>
> May I ask if this field-setter access is something I need to turn on or
> off? I hope so. I want to enforce my usage to go through methods.
>
> Paul
>
> Clinton Begin wrote:
> > Okay...
> >
> > I've made the change. It now uses fields only if a get or set method
> > doesn't exist. Of course, the decision is independent for get and
> > set, so if a set doesn't exist, but a get does, it will use the field
> > for setting, but the getter for getting. I've also enabled private
> > constructor access.
> >
> > Basically this means, iBATIS now works with POJOs for real... we don't
> > depend on the JavaBeans spec at all really. You can use your own
> > property syntax and private default constructors with parameterized
> > constructors for programmatic construction.
> >
> > Pretty cool stuff really.
> >
> > Cheers,
> > Clinton
> >
> > On 2/10/07, Clinton Begin <cl...@gmail.com> wrote:
> >> > If you
> >> > have getters/setters then we'll use them. If not, then we'll use
> >> the fields
> >> > directly. End of story.
> >>
> >> This is my preference now.
> >>
> >> The person that asked me about field mappings that originally got me
> >> to work on it last week is of the mind that we should just keep it
> >> simple like this. Since that was your gut feeling as well as Paul's,
> >> I think we should run with it.
> >>
> >> I think we're over-thinking the solution now. Let us come down from
> >> our ivory tower. :-)
> >>
> >> Clinton
> >>
> >> On 2/10/07, Jeff Butler <je...@gmail.com> wrote:
> >> > Is there any realistic non-academic use case for bypassing the
> >> > getters/setters if they exist? In other words, if you want to go by
> >> plane
> >> > then don't rent a car :)
> >> >
> >> > We really encourage people to keep their POJOs simple. I'd sure
> >> hate to see
> >> > us encourage wierd or overly complex design just because we can.
> >> Maybe we
> >> > should bypass all the non-standard syntax and configuration
> >> options. If you
> >> > have getters/setters then we'll use them. If not, then we'll use
> >> the fields
> >> > directly. End of story.
> >> >
> >> > Jeff Butler
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
> >> > > OGNL uses property notation syntax which calls getters and
> >> setters. As
> >> > > for the parenthesis syntax, there is no precedent in the market
> >> for such
> >> > > a syntax being used to access fields directly. The syntax should
> >> be the
> >> > > same (I want to navigate to X), with an additional attribute
> >> specifying
> >> > > how it should be done (take me by plane or car).
> >> > >
> >> > > Paul
> >> > >
> >> > >
> >> > >
> >> >
> >>
> >
>
Re: Direct-to-Field mappings now implemented.
Posted by Paul Benedict <pb...@apache.org>.
Clinton,
That's awesome! Good job!
May I ask if this field-setter access is something I need to turn on or
off? I hope so. I want to enforce my usage to go through methods.
Paul
Clinton Begin wrote:
> Okay...
>
> I've made the change. It now uses fields only if a get or set method
> doesn't exist. Of course, the decision is independent for get and
> set, so if a set doesn't exist, but a get does, it will use the field
> for setting, but the getter for getting. I've also enabled private
> constructor access.
>
> Basically this means, iBATIS now works with POJOs for real... we don't
> depend on the JavaBeans spec at all really. You can use your own
> property syntax and private default constructors with parameterized
> constructors for programmatic construction.
>
> Pretty cool stuff really.
>
> Cheers,
> Clinton
>
> On 2/10/07, Clinton Begin <cl...@gmail.com> wrote:
>> > If you
>> > have getters/setters then we'll use them. If not, then we'll use
>> the fields
>> > directly. End of story.
>>
>> This is my preference now.
>>
>> The person that asked me about field mappings that originally got me
>> to work on it last week is of the mind that we should just keep it
>> simple like this. Since that was your gut feeling as well as Paul's,
>> I think we should run with it.
>>
>> I think we're over-thinking the solution now. Let us come down from
>> our ivory tower. :-)
>>
>> Clinton
>>
>> On 2/10/07, Jeff Butler <je...@gmail.com> wrote:
>> > Is there any realistic non-academic use case for bypassing the
>> > getters/setters if they exist? In other words, if you want to go by
>> plane
>> > then don't rent a car :)
>> >
>> > We really encourage people to keep their POJOs simple. I'd sure
>> hate to see
>> > us encourage wierd or overly complex design just because we can.
>> Maybe we
>> > should bypass all the non-standard syntax and configuration
>> options. If you
>> > have getters/setters then we'll use them. If not, then we'll use
>> the fields
>> > directly. End of story.
>> >
>> > Jeff Butler
>> >
>> >
>> >
>> >
>> >
>> > On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
>> > > OGNL uses property notation syntax which calls getters and
>> setters. As
>> > > for the parenthesis syntax, there is no precedent in the market
>> for such
>> > > a syntax being used to access fields directly. The syntax should
>> be the
>> > > same (I want to navigate to X), with an additional attribute
>> specifying
>> > > how it should be done (take me by plane or car).
>> > >
>> > > Paul
>> > >
>> > >
>> > >
>> >
>>
>
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
Okay...
I've made the change. It now uses fields only if a get or set method
doesn't exist. Of course, the decision is independent for get and
set, so if a set doesn't exist, but a get does, it will use the field
for setting, but the getter for getting. I've also enabled private
constructor access.
Basically this means, iBATIS now works with POJOs for real... we don't
depend on the JavaBeans spec at all really. You can use your own
property syntax and private default constructors with parameterized
constructors for programmatic construction.
Pretty cool stuff really.
Cheers,
Clinton
On 2/10/07, Clinton Begin <cl...@gmail.com> wrote:
> > If you
> > have getters/setters then we'll use them. If not, then we'll use the fields
> > directly. End of story.
>
> This is my preference now.
>
> The person that asked me about field mappings that originally got me
> to work on it last week is of the mind that we should just keep it
> simple like this. Since that was your gut feeling as well as Paul's,
> I think we should run with it.
>
> I think we're over-thinking the solution now. Let us come down from
> our ivory tower. :-)
>
> Clinton
>
> On 2/10/07, Jeff Butler <je...@gmail.com> wrote:
> > Is there any realistic non-academic use case for bypassing the
> > getters/setters if they exist? In other words, if you want to go by plane
> > then don't rent a car :)
> >
> > We really encourage people to keep their POJOs simple. I'd sure hate to see
> > us encourage wierd or overly complex design just because we can. Maybe we
> > should bypass all the non-standard syntax and configuration options. If you
> > have getters/setters then we'll use them. If not, then we'll use the fields
> > directly. End of story.
> >
> > Jeff Butler
> >
> >
> >
> >
> >
> > On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
> > > OGNL uses property notation syntax which calls getters and setters. As
> > > for the parenthesis syntax, there is no precedent in the market for such
> > > a syntax being used to access fields directly. The syntax should be the
> > > same (I want to navigate to X), with an additional attribute specifying
> > > how it should be done (take me by plane or car).
> > >
> > > Paul
> > >
> > >
> > >
> >
>
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
> If you
> have getters/setters then we'll use them. If not, then we'll use the fields
> directly. End of story.
This is my preference now.
The person that asked me about field mappings that originally got me
to work on it last week is of the mind that we should just keep it
simple like this. Since that was your gut feeling as well as Paul's,
I think we should run with it.
I think we're over-thinking the solution now. Let us come down from
our ivory tower. :-)
Clinton
On 2/10/07, Jeff Butler <je...@gmail.com> wrote:
> Is there any realistic non-academic use case for bypassing the
> getters/setters if they exist? In other words, if you want to go by plane
> then don't rent a car :)
>
> We really encourage people to keep their POJOs simple. I'd sure hate to see
> us encourage wierd or overly complex design just because we can. Maybe we
> should bypass all the non-standard syntax and configuration options. If you
> have getters/setters then we'll use them. If not, then we'll use the fields
> directly. End of story.
>
> Jeff Butler
>
>
>
>
>
> On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
> > OGNL uses property notation syntax which calls getters and setters. As
> > for the parenthesis syntax, there is no precedent in the market for such
> > a syntax being used to access fields directly. The syntax should be the
> > same (I want to navigate to X), with an additional attribute specifying
> > how it should be done (take me by plane or car).
> >
> > Paul
> >
> >
> >
>
Re: Direct-to-Field mappings now implemented.
Posted by Paul Benedict <pb...@apache.org>.
Ah, non-academic use case... I don't mean to start a flame war, but
"Hibernate has it!" :-) There's probably a good chance a user of
Hibernate may have recommended this feature. And the purpose is to allow
properties to be set without having to expose getters.
I am strongly against allowing the developer to go fields explicitly. It
should be used totally as a fallback mechanism, and only then if
enabled. I agree with Jeff.
Paul
Jeff Butler wrote:
> Is there any realistic non-academic use case for bypassing the
> getters/setters if they exist? In other words, if you want to go by
> plane then don't rent a car :)
>
> We really encourage people to keep their POJOs simple. I'd sure hate to
> see us encourage wierd or overly complex design just because we can.
> Maybe we should bypass all the non-standard syntax and configuration
> options. If you have getters/setters then we'll use them. If not, then
> we'll use the fields directly. End of story.
>
> Jeff Butler
>
>
>
>
> On 2/10/07, *Paul Benedict* <pbenedict@apache.org
> <ma...@apache.org>> wrote:
>
> OGNL uses property notation syntax which calls getters and setters. As
> for the parenthesis syntax, there is no precedent in the market for
> such
> a syntax being used to access fields directly. The syntax should be the
> same (I want to navigate to X), with an additional attribute specifying
> how it should be done (take me by plane or car).
>
> Paul
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Jeff Butler <je...@gmail.com>.
Is there any realistic non-academic use case for bypassing the
getters/setters if they exist? In other words, if you want to go by plane
then don't rent a car :)
We really encourage people to keep their POJOs simple. I'd sure hate to see
us encourage wierd or overly complex design just because we can. Maybe we
should bypass all the non-standard syntax and configuration options. If you
have getters/setters then we'll use them. If not, then we'll use the fields
directly. End of story.
Jeff Butler
On 2/10/07, Paul Benedict <pb...@apache.org> wrote:
>
> OGNL uses property notation syntax which calls getters and setters. As
> for the parenthesis syntax, there is no precedent in the market for such
> a syntax being used to access fields directly. The syntax should be the
> same (I want to navigate to X), with an additional attribute specifying
> how it should be done (take me by plane or car).
>
> Paul
>
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Paul Benedict <pb...@apache.org>.
OGNL uses property notation syntax which calls getters and setters. As
for the parenthesis syntax, there is no precedent in the market for such
a syntax being used to access fields directly. The syntax should be the
same (I want to navigate to X), with an additional attribute specifying
how it should be done (take me by plane or car).
Paul
Jeff Butler wrote:
> I haven't looked into it but what do OGNL or other frameworks do? Do
> they offer some way to pick and choose between getters/setters and
> direct field access? If someone else has already solved this problem,
> naybe we could leverage their ideas.
>
> Given no other guidance, I do like the idea of using getters/setters
> first and then rolling back to direct field access. But maybe the
> parenthesis syntax is OK if someone wants to force direct field access
> and bypass the getters/setters. The syntax without parenthesis would
> work in most cases, but this would also give a way to bypass the
> getters/setters if someone wanted to do something wierd.
>
> Jeff Butler
>
>
> On 2/10/07, *Brandon Goodin* <brandon.goodin@gmail.com
> <ma...@gmail.com>> wrote:
>
> Correction
>
> * a fieldMappingEnabled=true/false...
>
>
> On 2/10/07, *Brandon Goodin* <brandon.goodin@gmail.com
> <ma...@gmail.com>> wrote:
>
> To avoid the unpredictability of this functionality couldn't we
> add some configure options like:
>
> * a diretoryToMappintEnabled=true/false property on the SQL Map
> Config. This would set it globally. False would follow strict
> bean and (eventually) constructor setting.
> * To bring further clarity we should define the lookup order in
> our docs. First a setter is attempted and then a property is
> attempted ( I would guess)
> * Perhaps you could even go as far as placing a
> reverseLookup=true/false field on mappings so that the field is
> examined before the setter this could be done in the inline and
> xml based mappings.
>
> Just some thoughts that may provide our usual implicit/explicit
> options. Layout the functionality to act in a common known way
> and provide the ability to tweak it when needed.
>
> Brandon
>
> On 2/9/07, *Clinton Begin* <clinton.begin@gmail.com
> <ma...@gmail.com>> wrote:
>
> No, what Jeff originally described in this thread, that you
> already
> agreed with. ;-)
>
> Clinton
>
> On 2/9/07, Paul Benedict < pbenedict@apache.org
> <ma...@apache.org>> wrote:
> > I searched the mail archives, but I am not privy to what
> Jeff originally
> > described. Is it anything similar to what I've been
> talking about?
> > Please send me a link or email :-)
> >
> > Thanks!
> > Paul
> >
> > Clinton Begin wrote:
> > > Okay guys. I'm convinced. Let's give this thread 24
> hours for anyone
> > > else who wants to chime in. If nobody speaks up, we'll
> implement it
> > > the way Jeff described it originally.
> > >
> > > I think it will be cool regardless. I'm actually
> feeling pretty dumb
> > > for not implementing this 3 years ago...it was way too
> easy to have
> > > not done it long ago. it was a couple of extra methods
> and a few line
> > > changes in about 5 classes... :-/
> > >
> > > Cheers,
> > > Clinton
> > >
> > > On 2/9/07, Poitras Christian
> <Christian.Poitras@ircm.qc.ca
> <ma...@ircm.qc.ca>> wrote:
> > >>
> > >>
> > >> I guess you have a point.
> > >>
> > >> Probably 90% of developpers won't want to know how the
> real path used...
> > >> Even if knowing it is interesting, it might disapoint
> people to force
> > >> them
> > >> to know it in advance.
> > >> In other cases, getters may include code that will be
> skipped using
> > >> direct
> > >> field access.
> > >>
> > >> Now the point to this email is that iBATIS didn't force
> people to have an
> > >> idea of the implementation before writting xml files.
> Changing this habit
> > >> may reduce the interest of iBATIS as a simple tool for
> O/R mapping.
> > >> Personally, I am afraid of the reactions some people
> will have when
> > >> they'll
> > >> begin mixing beans, pojos and maps (all 3 for crazy
> people only!, but
> > >> most
> > >> pojos/maps users).
> > >> Another problem will arise with resultMaps that will
> need this
> > >> notation at
> > >> the same time (to know if we call a setter or a use the
> field).
> > >>
> > >> I personally think it is to late to force people to
> change their iBATIS
> > >> habit. But make sure that they'll know what the
> framework will do. For
> > >> instance calling the getter if present, if not
> accessing the field
> > >> directly.
> > >>
> > >> Maybe the notation can be optionnal and will force
> iBATIS to try
> > >> accessing
> > >> the field first, then the getter if field is not
> present. Think this
> > >> would
> > >> do?
> > >>
> > >> Christian
> > >>
> > >> ________________________________
> > >> From: paulus.benedictus@gmail.com
> <ma...@gmail.com>
> > >> [mailto:paulus.benedictus@gmail.com
> <ma...@gmail.com>] On
> > >> Behalf Of Paul Benedict
> > >> Sent: Friday, 09 February 2007 15:17
> > >> To: dev@ibatis.apache.org <ma...@ibatis.apache.org>
> > >> Subject: Re: Direct-to-Field mappings now implemented.
> > >>
> > >>
> > >> Poitras and Clinton,
> > >>
> > >> I agree. The refactoring argument is pretty strong.
> Property notation is
> > >> script-like because the actual means to get to the
> value (method vs.
> > >> direct-field access) is totally secondary to the
> intention. The developer
> > >> just needs to express the path, and the framework
> should be intelligent
> > >> enough to get there. But we can't assume the developer
> always wants
> > >> direct-field access, which is why the option must be
> turned on.
> > >>
> > >> PS: -1 on the brackets.
> > >>
> > >> Paul
> > >>
> > >
> >
>
>
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Jeff Butler <je...@gmail.com>.
I haven't looked into it but what do OGNL or other frameworks do? Do they
offer some way to pick and choose between getters/setters and direct field
access? If someone else has already solved this problem, naybe we could
leverage their ideas.
Given no other guidance, I do like the idea of using getters/setters first
and then rolling back to direct field access. But maybe the parenthesis
syntax is OK if someone wants to force direct field access and bypass the
getters/setters. The syntax without parenthesis would work in most cases,
but this would also give a way to bypass the getters/setters if someone
wanted to do something wierd.
Jeff Butler
On 2/10/07, Brandon Goodin <br...@gmail.com> wrote:
>
> Correction
>
> * a fieldMappingEnabled=true/false...
>
> On 2/10/07, Brandon Goodin <brandon.goodin@gmail.com > wrote:
> >
> > To avoid the unpredictability of this functionality couldn't we add some
> > configure options like:
> >
> > * a diretoryToMappintEnabled=true/false property on the SQL Map Config.
> > This would set it globally. False would follow strict bean and (eventually)
> > constructor setting.
> > * To bring further clarity we should define the lookup order in our
> > docs. First a setter is attempted and then a property is attempted ( I would
> > guess)
> > * Perhaps you could even go as far as placing a reverseLookup=true/false
> > field on mappings so that the field is examined before the setter this could
> > be done in the inline and xml based mappings.
> >
> > Just some thoughts that may provide our usual implicit/explicit options.
> > Layout the functionality to act in a common known way and provide the
> > ability to tweak it when needed.
> >
> > Brandon
> >
> > On 2/9/07, Clinton Begin <cl...@gmail.com> wrote:
> > >
> > > No, what Jeff originally described in this thread, that you already
> > > agreed with. ;-)
> > >
> > > Clinton
> > >
> > > On 2/9/07, Paul Benedict < pbenedict@apache.org> wrote:
> > > > I searched the mail archives, but I am not privy to what Jeff
> > > originally
> > > > described. Is it anything similar to what I've been talking about?
> > > > Please send me a link or email :-)
> > > >
> > > > Thanks!
> > > > Paul
> > > >
> > > > Clinton Begin wrote:
> > > > > Okay guys. I'm convinced. Let's give this thread 24 hours for
> > > anyone
> > > > > else who wants to chime in. If nobody speaks up, we'll implement
> > > it
> > > > > the way Jeff described it originally.
> > > > >
> > > > > I think it will be cool regardless. I'm actually feeling pretty
> > > dumb
> > > > > for not implementing this 3 years ago...it was way too easy to
> > > have
> > > > > not done it long ago. it was a couple of extra methods and a few
> > > line
> > > > > changes in about 5 classes... :-/
> > > > >
> > > > > Cheers,
> > > > > Clinton
> > > > >
> > > > > On 2/9/07, Poitras Christian <Christian.Poitras@ircm.qc.ca >
> > > wrote:
> > > > >>
> > > > >>
> > > > >> I guess you have a point.
> > > > >>
> > > > >> Probably 90% of developpers won't want to know how the real path
> > > used...
> > > > >> Even if knowing it is interesting, it might disapoint people to
> > > force
> > > > >> them
> > > > >> to know it in advance.
> > > > >> In other cases, getters may include code that will be skipped
> > > using
> > > > >> direct
> > > > >> field access.
> > > > >>
> > > > >> Now the point to this email is that iBATIS didn't force people to
> > > have an
> > > > >> idea of the implementation before writting xml files. Changing
> > > this habit
> > > > >> may reduce the interest of iBATIS as a simple tool for O/R
> > > mapping.
> > > > >> Personally, I am afraid of the reactions some people will have
> > > when
> > > > >> they'll
> > > > >> begin mixing beans, pojos and maps (all 3 for crazy people only!,
> > > but
> > > > >> most
> > > > >> pojos/maps users).
> > > > >> Another problem will arise with resultMaps that will need this
> > > > >> notation at
> > > > >> the same time (to know if we call a setter or a use the field).
> > > > >>
> > > > >> I personally think it is to late to force people to change their
> > > iBATIS
> > > > >> habit. But make sure that they'll know what the framework will
> > > do. For
> > > > >> instance calling the getter if present, if not accessing the
> > > field
> > > > >> directly.
> > > > >>
> > > > >> Maybe the notation can be optionnal and will force iBATIS to try
> > > > >> accessing
> > > > >> the field first, then the getter if field is not present. Think
> > > this
> > > > >> would
> > > > >> do?
> > > > >>
> > > > >> Christian
> > > > >>
> > > > >> ________________________________
> > > > >> From: paulus.benedictus@gmail.com
> > > > >> [mailto:paulus.benedictus@gmail.com] On
> > > > >> Behalf Of Paul Benedict
> > > > >> Sent: Friday, 09 February 2007 15:17
> > > > >> To: dev@ibatis.apache.org
> > > > >> Subject: Re: Direct-to-Field mappings now implemented.
> > > > >>
> > > > >>
> > > > >> Poitras and Clinton,
> > > > >>
> > > > >> I agree. The refactoring argument is pretty strong. Property
> > > notation is
> > > > >> script-like because the actual means to get to the value (method
> > > vs.
> > > > >> direct-field access) is totally secondary to the intention. The
> > > developer
> > > > >> just needs to express the path, and the framework should be
> > > intelligent
> > > > >> enough to get there. But we can't assume the developer always
> > > wants
> > > > >> direct-field access, which is why the option must be turned on.
> > > > >>
> > > > >> PS: -1 on the brackets.
> > > > >>
> > > > >> Paul
> > > > >>
> > > > >
> > > >
> > >
> >
> >
>
Re: Direct-to-Field mappings now implemented.
Posted by Brandon Goodin <br...@gmail.com>.
Correction
* a fieldMappingEnabled=true/false...
On 2/10/07, Brandon Goodin <br...@gmail.com> wrote:
>
> To avoid the unpredictability of this functionality couldn't we add some
> configure options like:
>
> * a diretoryToMappintEnabled=true/false property on the SQL Map Config.
> This would set it globally. False would follow strict bean and (eventually)
> constructor setting.
> * To bring further clarity we should define the lookup order in our docs.
> First a setter is attempted and then a property is attempted ( I would
> guess)
> * Perhaps you could even go as far as placing a reverseLookup=true/false
> field on mappings so that the field is examined before the setter this could
> be done in the inline and xml based mappings.
>
> Just some thoughts that may provide our usual implicit/explicit options.
> Layout the functionality to act in a common known way and provide the
> ability to tweak it when needed.
>
> Brandon
>
> On 2/9/07, Clinton Begin <cl...@gmail.com> wrote:
> >
> > No, what Jeff originally described in this thread, that you already
> > agreed with. ;-)
> >
> > Clinton
> >
> > On 2/9/07, Paul Benedict <pb...@apache.org> wrote:
> > > I searched the mail archives, but I am not privy to what Jeff
> > originally
> > > described. Is it anything similar to what I've been talking about?
> > > Please send me a link or email :-)
> > >
> > > Thanks!
> > > Paul
> > >
> > > Clinton Begin wrote:
> > > > Okay guys. I'm convinced. Let's give this thread 24 hours for
> > anyone
> > > > else who wants to chime in. If nobody speaks up, we'll implement it
> > > > the way Jeff described it originally.
> > > >
> > > > I think it will be cool regardless. I'm actually feeling pretty
> > dumb
> > > > for not implementing this 3 years ago...it was way too easy to have
> > > > not done it long ago. it was a couple of extra methods and a few
> > line
> > > > changes in about 5 classes... :-/
> > > >
> > > > Cheers,
> > > > Clinton
> > > >
> > > > On 2/9/07, Poitras Christian <Ch...@ircm.qc.ca> wrote:
> > > >>
> > > >>
> > > >> I guess you have a point.
> > > >>
> > > >> Probably 90% of developpers won't want to know how the real path
> > used...
> > > >> Even if knowing it is interesting, it might disapoint people to
> > force
> > > >> them
> > > >> to know it in advance.
> > > >> In other cases, getters may include code that will be skipped using
> > > >> direct
> > > >> field access.
> > > >>
> > > >> Now the point to this email is that iBATIS didn't force people to
> > have an
> > > >> idea of the implementation before writting xml files. Changing this
> > habit
> > > >> may reduce the interest of iBATIS as a simple tool for O/R mapping.
> >
> > > >> Personally, I am afraid of the reactions some people will have when
> > > >> they'll
> > > >> begin mixing beans, pojos and maps (all 3 for crazy people only!,
> > but
> > > >> most
> > > >> pojos/maps users).
> > > >> Another problem will arise with resultMaps that will need this
> > > >> notation at
> > > >> the same time (to know if we call a setter or a use the field).
> > > >>
> > > >> I personally think it is to late to force people to change their
> > iBATIS
> > > >> habit. But make sure that they'll know what the framework will do.
> > For
> > > >> instance calling the getter if present, if not accessing the field
> > > >> directly.
> > > >>
> > > >> Maybe the notation can be optionnal and will force iBATIS to try
> > > >> accessing
> > > >> the field first, then the getter if field is not present. Think
> > this
> > > >> would
> > > >> do?
> > > >>
> > > >> Christian
> > > >>
> > > >> ________________________________
> > > >> From: paulus.benedictus@gmail.com
> > > >> [mailto:paulus.benedictus@gmail.com] On
> > > >> Behalf Of Paul Benedict
> > > >> Sent: Friday, 09 February 2007 15:17
> > > >> To: dev@ibatis.apache.org
> > > >> Subject: Re: Direct-to-Field mappings now implemented.
> > > >>
> > > >>
> > > >> Poitras and Clinton,
> > > >>
> > > >> I agree. The refactoring argument is pretty strong. Property
> > notation is
> > > >> script-like because the actual means to get to the value (method
> > vs.
> > > >> direct-field access) is totally secondary to the intention. The
> > developer
> > > >> just needs to express the path, and the framework should be
> > intelligent
> > > >> enough to get there. But we can't assume the developer always wants
> > > >> direct-field access, which is why the option must be turned on.
> > > >>
> > > >> PS: -1 on the brackets.
> > > >>
> > > >> Paul
> > > >>
> > > >
> > >
> >
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Brandon Goodin <br...@gmail.com>.
To avoid the unpredictability of this functionality couldn't we add some
configure options like:
* a diretoryToMappintEnabled=true/false property on the SQL Map Config. This
would set it globally. False would follow strict bean and (eventually)
constructor setting.
* To bring further clarity we should define the lookup order in our docs.
First a setter is attempted and then a property is attempted ( I would
guess)
* Perhaps you could even go as far as placing a reverseLookup=true/false
field on mappings so that the field is examined before the setter this could
be done in the inline and xml based mappings.
Just some thoughts that may provide our usual implicit/explicit options.
Layout the functionality to act in a common known way and provide the
ability to tweak it when needed.
Brandon
On 2/9/07, Clinton Begin <cl...@gmail.com> wrote:
>
> No, what Jeff originally described in this thread, that you already
> agreed with. ;-)
>
> Clinton
>
> On 2/9/07, Paul Benedict <pb...@apache.org> wrote:
> > I searched the mail archives, but I am not privy to what Jeff originally
> > described. Is it anything similar to what I've been talking about?
> > Please send me a link or email :-)
> >
> > Thanks!
> > Paul
> >
> > Clinton Begin wrote:
> > > Okay guys. I'm convinced. Let's give this thread 24 hours for anyone
> > > else who wants to chime in. If nobody speaks up, we'll implement it
> > > the way Jeff described it originally.
> > >
> > > I think it will be cool regardless. I'm actually feeling pretty dumb
> > > for not implementing this 3 years ago...it was way too easy to have
> > > not done it long ago. it was a couple of extra methods and a few line
> > > changes in about 5 classes... :-/
> > >
> > > Cheers,
> > > Clinton
> > >
> > > On 2/9/07, Poitras Christian <Ch...@ircm.qc.ca> wrote:
> > >>
> > >>
> > >> I guess you have a point.
> > >>
> > >> Probably 90% of developpers won't want to know how the real path
> used...
> > >> Even if knowing it is interesting, it might disapoint people to force
> > >> them
> > >> to know it in advance.
> > >> In other cases, getters may include code that will be skipped using
> > >> direct
> > >> field access.
> > >>
> > >> Now the point to this email is that iBATIS didn't force people to
> have an
> > >> idea of the implementation before writting xml files. Changing this
> habit
> > >> may reduce the interest of iBATIS as a simple tool for O/R mapping.
> > >> Personally, I am afraid of the reactions some people will have when
> > >> they'll
> > >> begin mixing beans, pojos and maps (all 3 for crazy people only!, but
> > >> most
> > >> pojos/maps users).
> > >> Another problem will arise with resultMaps that will need this
> > >> notation at
> > >> the same time (to know if we call a setter or a use the field).
> > >>
> > >> I personally think it is to late to force people to change their
> iBATIS
> > >> habit. But make sure that they'll know what the framework will do.
> For
> > >> instance calling the getter if present, if not accessing the field
> > >> directly.
> > >>
> > >> Maybe the notation can be optionnal and will force iBATIS to try
> > >> accessing
> > >> the field first, then the getter if field is not present. Think this
> > >> would
> > >> do?
> > >>
> > >> Christian
> > >>
> > >> ________________________________
> > >> From: paulus.benedictus@gmail.com
> > >> [mailto:paulus.benedictus@gmail.com] On
> > >> Behalf Of Paul Benedict
> > >> Sent: Friday, 09 February 2007 15:17
> > >> To: dev@ibatis.apache.org
> > >> Subject: Re: Direct-to-Field mappings now implemented.
> > >>
> > >>
> > >> Poitras and Clinton,
> > >>
> > >> I agree. The refactoring argument is pretty strong. Property notation
> is
> > >> script-like because the actual means to get to the value (method vs.
> > >> direct-field access) is totally secondary to the intention. The
> developer
> > >> just needs to express the path, and the framework should be
> intelligent
> > >> enough to get there. But we can't assume the developer always wants
> > >> direct-field access, which is why the option must be turned on.
> > >>
> > >> PS: -1 on the brackets.
> > >>
> > >> Paul
> > >>
> > >
> >
>
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
No, what Jeff originally described in this thread, that you already
agreed with. ;-)
Clinton
On 2/9/07, Paul Benedict <pb...@apache.org> wrote:
> I searched the mail archives, but I am not privy to what Jeff originally
> described. Is it anything similar to what I've been talking about?
> Please send me a link or email :-)
>
> Thanks!
> Paul
>
> Clinton Begin wrote:
> > Okay guys. I'm convinced. Let's give this thread 24 hours for anyone
> > else who wants to chime in. If nobody speaks up, we'll implement it
> > the way Jeff described it originally.
> >
> > I think it will be cool regardless. I'm actually feeling pretty dumb
> > for not implementing this 3 years ago...it was way too easy to have
> > not done it long ago. it was a couple of extra methods and a few line
> > changes in about 5 classes... :-/
> >
> > Cheers,
> > Clinton
> >
> > On 2/9/07, Poitras Christian <Ch...@ircm.qc.ca> wrote:
> >>
> >>
> >> I guess you have a point.
> >>
> >> Probably 90% of developpers won't want to know how the real path used...
> >> Even if knowing it is interesting, it might disapoint people to force
> >> them
> >> to know it in advance.
> >> In other cases, getters may include code that will be skipped using
> >> direct
> >> field access.
> >>
> >> Now the point to this email is that iBATIS didn't force people to have an
> >> idea of the implementation before writting xml files. Changing this habit
> >> may reduce the interest of iBATIS as a simple tool for O/R mapping.
> >> Personally, I am afraid of the reactions some people will have when
> >> they'll
> >> begin mixing beans, pojos and maps (all 3 for crazy people only!, but
> >> most
> >> pojos/maps users).
> >> Another problem will arise with resultMaps that will need this
> >> notation at
> >> the same time (to know if we call a setter or a use the field).
> >>
> >> I personally think it is to late to force people to change their iBATIS
> >> habit. But make sure that they'll know what the framework will do. For
> >> instance calling the getter if present, if not accessing the field
> >> directly.
> >>
> >> Maybe the notation can be optionnal and will force iBATIS to try
> >> accessing
> >> the field first, then the getter if field is not present. Think this
> >> would
> >> do?
> >>
> >> Christian
> >>
> >> ________________________________
> >> From: paulus.benedictus@gmail.com
> >> [mailto:paulus.benedictus@gmail.com] On
> >> Behalf Of Paul Benedict
> >> Sent: Friday, 09 February 2007 15:17
> >> To: dev@ibatis.apache.org
> >> Subject: Re: Direct-to-Field mappings now implemented.
> >>
> >>
> >> Poitras and Clinton,
> >>
> >> I agree. The refactoring argument is pretty strong. Property notation is
> >> script-like because the actual means to get to the value (method vs.
> >> direct-field access) is totally secondary to the intention. The developer
> >> just needs to express the path, and the framework should be intelligent
> >> enough to get there. But we can't assume the developer always wants
> >> direct-field access, which is why the option must be turned on.
> >>
> >> PS: -1 on the brackets.
> >>
> >> Paul
> >>
> >
>
Re: Direct-to-Field mappings now implemented.
Posted by Paul Benedict <pb...@apache.org>.
I searched the mail archives, but I am not privy to what Jeff originally
described. Is it anything similar to what I've been talking about?
Please send me a link or email :-)
Thanks!
Paul
Clinton Begin wrote:
> Okay guys. I'm convinced. Let's give this thread 24 hours for anyone
> else who wants to chime in. If nobody speaks up, we'll implement it
> the way Jeff described it originally.
>
> I think it will be cool regardless. I'm actually feeling pretty dumb
> for not implementing this 3 years ago...it was way too easy to have
> not done it long ago. it was a couple of extra methods and a few line
> changes in about 5 classes... :-/
>
> Cheers,
> Clinton
>
> On 2/9/07, Poitras Christian <Ch...@ircm.qc.ca> wrote:
>>
>>
>> I guess you have a point.
>>
>> Probably 90% of developpers won't want to know how the real path used...
>> Even if knowing it is interesting, it might disapoint people to force
>> them
>> to know it in advance.
>> In other cases, getters may include code that will be skipped using
>> direct
>> field access.
>>
>> Now the point to this email is that iBATIS didn't force people to have an
>> idea of the implementation before writting xml files. Changing this habit
>> may reduce the interest of iBATIS as a simple tool for O/R mapping.
>> Personally, I am afraid of the reactions some people will have when
>> they'll
>> begin mixing beans, pojos and maps (all 3 for crazy people only!, but
>> most
>> pojos/maps users).
>> Another problem will arise with resultMaps that will need this
>> notation at
>> the same time (to know if we call a setter or a use the field).
>>
>> I personally think it is to late to force people to change their iBATIS
>> habit. But make sure that they'll know what the framework will do. For
>> instance calling the getter if present, if not accessing the field
>> directly.
>>
>> Maybe the notation can be optionnal and will force iBATIS to try
>> accessing
>> the field first, then the getter if field is not present. Think this
>> would
>> do?
>>
>> Christian
>>
>> ________________________________
>> From: paulus.benedictus@gmail.com
>> [mailto:paulus.benedictus@gmail.com] On
>> Behalf Of Paul Benedict
>> Sent: Friday, 09 February 2007 15:17
>> To: dev@ibatis.apache.org
>> Subject: Re: Direct-to-Field mappings now implemented.
>>
>>
>> Poitras and Clinton,
>>
>> I agree. The refactoring argument is pretty strong. Property notation is
>> script-like because the actual means to get to the value (method vs.
>> direct-field access) is totally secondary to the intention. The developer
>> just needs to express the path, and the framework should be intelligent
>> enough to get there. But we can't assume the developer always wants
>> direct-field access, which is why the option must be turned on.
>>
>> PS: -1 on the brackets.
>>
>> Paul
>>
>
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
Okay guys. I'm convinced. Let's give this thread 24 hours for anyone
else who wants to chime in. If nobody speaks up, we'll implement it
the way Jeff described it originally.
I think it will be cool regardless. I'm actually feeling pretty dumb
for not implementing this 3 years ago...it was way too easy to have
not done it long ago. it was a couple of extra methods and a few line
changes in about 5 classes... :-/
Cheers,
Clinton
On 2/9/07, Poitras Christian <Ch...@ircm.qc.ca> wrote:
>
>
> I guess you have a point.
>
> Probably 90% of developpers won't want to know how the real path used...
> Even if knowing it is interesting, it might disapoint people to force them
> to know it in advance.
> In other cases, getters may include code that will be skipped using direct
> field access.
>
> Now the point to this email is that iBATIS didn't force people to have an
> idea of the implementation before writting xml files. Changing this habit
> may reduce the interest of iBATIS as a simple tool for O/R mapping.
> Personally, I am afraid of the reactions some people will have when they'll
> begin mixing beans, pojos and maps (all 3 for crazy people only!, but most
> pojos/maps users).
> Another problem will arise with resultMaps that will need this notation at
> the same time (to know if we call a setter or a use the field).
>
> I personally think it is to late to force people to change their iBATIS
> habit. But make sure that they'll know what the framework will do. For
> instance calling the getter if present, if not accessing the field directly.
>
> Maybe the notation can be optionnal and will force iBATIS to try accessing
> the field first, then the getter if field is not present. Think this would
> do?
>
> Christian
>
> ________________________________
> From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com] On
> Behalf Of Paul Benedict
> Sent: Friday, 09 February 2007 15:17
> To: dev@ibatis.apache.org
> Subject: Re: Direct-to-Field mappings now implemented.
>
>
> Poitras and Clinton,
>
> I agree. The refactoring argument is pretty strong. Property notation is
> script-like because the actual means to get to the value (method vs.
> direct-field access) is totally secondary to the intention. The developer
> just needs to express the path, and the framework should be intelligent
> enough to get there. But we can't assume the developer always wants
> direct-field access, which is why the option must be turned on.
>
> PS: -1 on the brackets.
>
> Paul
>
RE: Direct-to-Field mappings now implemented.
Posted by Poitras Christian <Ch...@ircm.qc.ca>.
I guess you have a point.
Probably 90% of developpers won't want to know how the real path used...
Even if knowing it is interesting, it might disapoint people to force
them to know it in advance.
In other cases, getters may include code that will be skipped using
direct field access.
Now the point to this email is that iBATIS didn't force people to have
an idea of the implementation before writting xml files. Changing this
habit may reduce the interest of iBATIS as a simple tool for O/R
mapping.
Personally, I am afraid of the reactions some people will have when
they'll begin mixing beans, pojos and maps (all 3 for crazy people
only!, but most pojos/maps users).
Another problem will arise with resultMaps that will need this notation
at the same time (to know if we call a setter or a use the field).
I personally think it is to late to force people to change their iBATIS
habit. But make sure that they'll know what the framework will do. For
instance calling the getter if present, if not accessing the field
directly.
Maybe the notation can be optionnal and will force iBATIS to try
accessing the field first, then the getter if field is not present.
Think this would do?
Christian
________________________________
From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com]
On Behalf Of Paul Benedict
Sent: Friday, 09 February 2007 15:17
To: dev@ibatis.apache.org
Subject: Re: Direct-to-Field mappings now implemented.
Poitras and Clinton,
I agree. The refactoring argument is pretty strong. Property notation is
script-like because the actual means to get to the value (method vs.
direct-field access) is totally secondary to the intention. The
developer just needs to express the path, and the framework should be
intelligent enough to get there. But we can't assume the developer
always wants direct-field access, which is why the option must be turned
on.
PS: -1 on the brackets.
Paul
Re: Direct-to-Field mappings now implemented.
Posted by Paul Benedict <pb...@apache.org>.
Poitras and Clinton,
I agree. The refactoring argument is pretty strong. Property notation is
script-like because the actual means to get to the value (method vs.
direct-field access) is totally secondary to the intention. The developer
just needs to express the path, and the framework should be intelligent
enough to get there. But we can't assume the developer always wants
direct-field access, which is why the option must be turned on.
PS: -1 on the brackets.
Paul
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
Yes it would. It's transparency vs. expressiveness and control.
I guess it would make it harder to refactor (i.e. encapsulate) a field
to a setter method later.
Hmmm....I'm slowly being won over. Keep going and you'll have me. ;-)
Does anyone like the (brackets)? If I'm the only one, I'll ditch them.
Clinton
On 2/9/07, Poitras Christian <Ch...@ircm.qc.ca> wrote:
> Your point is interesting, but wouldn't the () notation break maps
> transparency?
>
> -----Original Message-----
> From: Clinton Begin [mailto:clinton.begin@gmail.com]
> Sent: Friday, 09 February 2007 14:00
> To: dev@ibatis.apache.org
> Subject: Re: Direct-to-Field mappings now implemented.
>
> It would be easy to do what you describe (very easy actually). And
> performance would not suffer at all.
>
> However, I did it specifically because of JavaBean syntax and naming
> conflicts. 99% of JavaBeans are written using something like:
>
> String name;
> public String getName();
>
> Hence a naming conflict between the field "name" and the property
> "name".
>
> The .NET version does exactly what you describe, and to be honest, I did
> not like it at all. It was very unintuitive and it had me guessing
> which it would use. Also, one of my early design mistakes
> (IMHO) was making maps transparent by using the same .dot notation as
> JavaBeans properties. I feel it was a mistake to do so.
>
> iBATIS has a good history of being predictable because it avoids
> guessing and magic. When I read a SQL Map, I know exactly what it's
> going to do and where my data is going to go (with the exception of the
> hashmap issue).
>
> To ensure that it stays that way, I personally think being explicit here
> is the best route.
>
> Can anyone else support the points made by Paul and Jeff? Thoughts?
>
> Clinton
>
>
> On 2/9/07, Paul Benedict <pb...@apache.org> wrote:
> > I agree with Jeff that an alternative syntax is questionable and
> > likely unnecessary. The syntax for accessing members of an object
> > should be the same, regardless if the property is an instance variable
>
> > or method. Rather, there should be a flag which enables direct
> > property access which will be used if no property method exists. If
> > you're concerned about performance, the probe should record the "best
> > route" so that this check isn't done every time.
> >
> > I recommend a new configuration setting be allowed in the global
> > configuration and (for overriding) on the resultMap:
> >
> > <resultMap ... directFieldAccessFallback="true">
> > <property col="street" name= "account.address.street"> </resultMap>
> >
> > Paul
> >
> >
> > On 2/9/07, Jeff Butler < jeffgbutler@gmail.com> wrote:
> > >
> > > I think this is a good idea.
> > >
> > > However, I wonder if it is necessary to add the extra syntax? Could
>
> > > we be
> > smart enough to use a getter/setter if one exists, else resort to
> > direct field access? Then there would be no need for the extra
> parenthesis syntax.
> > >
> > > Jeff Butler
> > >
> > >
> > >
> > >
> > > On 2/9/07, Clinton Begin <clinton.begin@gmail.com > wrote:
> > > > Hi all,
> > > >
> > > > I found a few hours tonight to implement direct-to-field mappings.
>
> > > > I don't have any energy left to explain it fully, but it's simple
> > > > to use, so here's the summary.
> > > >
> > > > To implement this, I changed the ClassInfo to accept a new pattern
>
> > > > of "property" access. You can now wrap a field names in round
> > > > brackets to distinguish them from properties. So:
> > > >
> > > > "id" is a property.
> > > > "(id)" is a field.
> > > >
> > > > These can be mixed with properties like:
> > > >
> > > > "account.(address).street"
> > > >
> > > > This last point is important and is the primary reason I didn't
> > > > use a new XML tag -- that would have severely limited the
> > > > mix-n-match ability of the feature (and it would have been harder
> to implement).
> > > >
> > > > This approach works for reads and writes and for both inline or
> > > > external parameter maps and result maps.
> > > >
> > > > It should be ubiquitous. Anywhere you used to use property names,
>
> > > > you can now use (field) names too.
> > > >
> > > > Thoughts? It's not too late to change the syntax (round brackets)
>
> > > > or anything else.
> > > >
> > > > I think it's the simplest, most flexible and performant approach.
> > > >
> > > > Cheers,
> > > > Clinton
> > > >
> > >
> > >
> >
> >
>
RE: Direct-to-Field mappings now implemented.
Posted by Poitras Christian <Ch...@ircm.qc.ca>.
Your point is interesting, but wouldn't the () notation break maps
transparency?
-----Original Message-----
From: Clinton Begin [mailto:clinton.begin@gmail.com]
Sent: Friday, 09 February 2007 14:00
To: dev@ibatis.apache.org
Subject: Re: Direct-to-Field mappings now implemented.
It would be easy to do what you describe (very easy actually). And
performance would not suffer at all.
However, I did it specifically because of JavaBean syntax and naming
conflicts. 99% of JavaBeans are written using something like:
String name;
public String getName();
Hence a naming conflict between the field "name" and the property
"name".
The .NET version does exactly what you describe, and to be honest, I did
not like it at all. It was very unintuitive and it had me guessing
which it would use. Also, one of my early design mistakes
(IMHO) was making maps transparent by using the same .dot notation as
JavaBeans properties. I feel it was a mistake to do so.
iBATIS has a good history of being predictable because it avoids
guessing and magic. When I read a SQL Map, I know exactly what it's
going to do and where my data is going to go (with the exception of the
hashmap issue).
To ensure that it stays that way, I personally think being explicit here
is the best route.
Can anyone else support the points made by Paul and Jeff? Thoughts?
Clinton
On 2/9/07, Paul Benedict <pb...@apache.org> wrote:
> I agree with Jeff that an alternative syntax is questionable and
> likely unnecessary. The syntax for accessing members of an object
> should be the same, regardless if the property is an instance variable
> or method. Rather, there should be a flag which enables direct
> property access which will be used if no property method exists. If
> you're concerned about performance, the probe should record the "best
> route" so that this check isn't done every time.
>
> I recommend a new configuration setting be allowed in the global
> configuration and (for overriding) on the resultMap:
>
> <resultMap ... directFieldAccessFallback="true">
> <property col="street" name= "account.address.street"> </resultMap>
>
> Paul
>
>
> On 2/9/07, Jeff Butler < jeffgbutler@gmail.com> wrote:
> >
> > I think this is a good idea.
> >
> > However, I wonder if it is necessary to add the extra syntax? Could
> > we be
> smart enough to use a getter/setter if one exists, else resort to
> direct field access? Then there would be no need for the extra
parenthesis syntax.
> >
> > Jeff Butler
> >
> >
> >
> >
> > On 2/9/07, Clinton Begin <clinton.begin@gmail.com > wrote:
> > > Hi all,
> > >
> > > I found a few hours tonight to implement direct-to-field mappings.
> > > I don't have any energy left to explain it fully, but it's simple
> > > to use, so here's the summary.
> > >
> > > To implement this, I changed the ClassInfo to accept a new pattern
> > > of "property" access. You can now wrap a field names in round
> > > brackets to distinguish them from properties. So:
> > >
> > > "id" is a property.
> > > "(id)" is a field.
> > >
> > > These can be mixed with properties like:
> > >
> > > "account.(address).street"
> > >
> > > This last point is important and is the primary reason I didn't
> > > use a new XML tag -- that would have severely limited the
> > > mix-n-match ability of the feature (and it would have been harder
to implement).
> > >
> > > This approach works for reads and writes and for both inline or
> > > external parameter maps and result maps.
> > >
> > > It should be ubiquitous. Anywhere you used to use property names,
> > > you can now use (field) names too.
> > >
> > > Thoughts? It's not too late to change the syntax (round brackets)
> > > or anything else.
> > >
> > > I think it's the simplest, most flexible and performant approach.
> > >
> > > Cheers,
> > > Clinton
> > >
> >
> >
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Clinton Begin <cl...@gmail.com>.
It would be easy to do what you describe (very easy actually). And
performance would not suffer at all.
However, I did it specifically because of JavaBean syntax and naming
conflicts. 99% of JavaBeans are written using something like:
String name;
public String getName();
Hence a naming conflict between the field "name" and the property "name".
The .NET version does exactly what you describe, and to be honest, I
did not like it at all. It was very unintuitive and it had me
guessing which it would use. Also, one of my early design mistakes
(IMHO) was making maps transparent by using the same .dot notation as
JavaBeans properties. I feel it was a mistake to do so.
iBATIS has a good history of being predictable because it avoids
guessing and magic. When I read a SQL Map, I know exactly what it's
going to do and where my data is going to go (with the exception of
the hashmap issue).
To ensure that it stays that way, I personally think being explicit
here is the best route.
Can anyone else support the points made by Paul and Jeff? Thoughts?
Clinton
On 2/9/07, Paul Benedict <pb...@apache.org> wrote:
> I agree with Jeff that an alternative syntax is questionable and likely
> unnecessary. The syntax for accessing members of an object should be the
> same, regardless if the property is an instance variable or method. Rather,
> there should be a flag which enables direct property access which will be
> used if no property method exists. If you're concerned about performance,
> the probe should record the "best route" so that this check isn't done every
> time.
>
> I recommend a new configuration setting be allowed in the global
> configuration and (for overriding) on the resultMap:
>
> <resultMap ... directFieldAccessFallback="true">
> <property col="street" name= "account.address.street">
> </resultMap>
>
> Paul
>
>
> On 2/9/07, Jeff Butler < jeffgbutler@gmail.com> wrote:
> >
> > I think this is a good idea.
> >
> > However, I wonder if it is necessary to add the extra syntax? Could we be
> smart enough to use a getter/setter if one exists, else resort to direct
> field access? Then there would be no need for the extra parenthesis syntax.
> >
> > Jeff Butler
> >
> >
> >
> >
> > On 2/9/07, Clinton Begin <clinton.begin@gmail.com > wrote:
> > > Hi all,
> > >
> > > I found a few hours tonight to implement direct-to-field mappings. I
> > > don't have any energy left to explain it fully, but it's simple to
> > > use, so here's the summary.
> > >
> > > To implement this, I changed the ClassInfo to accept a new pattern of
> > > "property" access. You can now wrap a field names in round brackets
> > > to distinguish them from properties. So:
> > >
> > > "id" is a property.
> > > "(id)" is a field.
> > >
> > > These can be mixed with properties like:
> > >
> > > "account.(address).street"
> > >
> > > This last point is important and is the primary reason I didn't use a
> > > new XML tag -- that would have severely limited the mix-n-match
> > > ability of the feature (and it would have been harder to implement).
> > >
> > > This approach works for reads and writes and for both inline or
> > > external parameter maps and result maps.
> > >
> > > It should be ubiquitous. Anywhere you used to use property names, you
> > > can now use (field) names too.
> > >
> > > Thoughts? It's not too late to change the syntax (round brackets) or
> > > anything else.
> > >
> > > I think it's the simplest, most flexible and performant approach.
> > >
> > > Cheers,
> > > Clinton
> > >
> >
> >
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Paul Benedict <pb...@apache.org>.
I agree with Jeff that an alternative syntax is questionable and likely
unnecessary. The syntax for accessing members of an object should be the
same, regardless if the property is an instance variable or method. Rather,
there should be a flag which enables direct property access which will be
used if no property method exists. If you're concerned about performance,
the probe should record the "best route" so that this check isn't done every
time.
I recommend a new configuration setting be allowed in the global
configuration and (for overriding) on the resultMap:
<resultMap ... directFieldAccessFallback="true">
<property col="street" name="account.address.street">
</resultMap>
Paul
On 2/9/07, Jeff Butler <je...@gmail.com> wrote:
>
> I think this is a good idea.
>
> However, I wonder if it is necessary to add the extra syntax? Could we be
> smart enough to use a getter/setter if one exists, else resort to direct
> field access? Then there would be no need for the extra parenthesis syntax.
>
>
> Jeff Butler
>
>
>
> On 2/9/07, Clinton Begin <cl...@gmail.com> wrote:
> >
> > Hi all,
> >
> > I found a few hours tonight to implement direct-to-field mappings. I
> > don't have any energy left to explain it fully, but it's simple to
> > use, so here's the summary.
> >
> > To implement this, I changed the ClassInfo to accept a new pattern of
> > "property" access. You can now wrap a field names in round brackets
> > to distinguish them from properties. So:
> >
> > "id" is a property.
> > "(id)" is a field.
> >
> > These can be mixed with properties like:
> >
> > "account.(address).street"
> >
> > This last point is important and is the primary reason I didn't use a
> > new XML tag -- that would have severely limited the mix-n-match
> > ability of the feature (and it would have been harder to implement).
> >
> > This approach works for reads and writes and for both inline or
> > external parameter maps and result maps.
> >
> > It should be ubiquitous. Anywhere you used to use property names, you
> > can now use (field) names too.
> >
> > Thoughts? It's not too late to change the syntax (round brackets) or
> > anything else.
> >
> > I think it's the simplest, most flexible and performant approach.
> >
> > Cheers,
> > Clinton
> >
>
>
Re: Direct-to-Field mappings now implemented.
Posted by Jeff Butler <je...@gmail.com>.
I think this is a good idea.
However, I wonder if it is necessary to add the extra syntax? Could we be
smart enough to use a getter/setter if one exists, else resort to direct
field access? Then there would be no need for the extra parenthesis syntax.
Jeff Butler
On 2/9/07, Clinton Begin <cl...@gmail.com> wrote:
>
> Hi all,
>
> I found a few hours tonight to implement direct-to-field mappings. I
> don't have any energy left to explain it fully, but it's simple to
> use, so here's the summary.
>
> To implement this, I changed the ClassInfo to accept a new pattern of
> "property" access. You can now wrap a field names in round brackets
> to distinguish them from properties. So:
>
> "id" is a property.
> "(id)" is a field.
>
> These can be mixed with properties like:
>
> "account.(address).street"
>
> This last point is important and is the primary reason I didn't use a
> new XML tag -- that would have severely limited the mix-n-match
> ability of the feature (and it would have been harder to implement).
>
> This approach works for reads and writes and for both inline or
> external parameter maps and result maps.
>
> It should be ubiquitous. Anywhere you used to use property names, you
> can now use (field) names too.
>
> Thoughts? It's not too late to change the syntax (round brackets) or
> anything else.
>
> I think it's the simplest, most flexible and performant approach.
>
> Cheers,
> Clinton
>