method lookup order performance benefit?
method lookup order performance benefit?
- Subject: method lookup order performance benefit?
- From: Michael Engelhart <email@hidden>
- Date: Mon, 26 Apr 2004 09:20:55 -0500
Hi -
I was looking at Apple's Inside WebObjects Web Applications
documentation last night and was reading the section on the Sync stage
of the request response cycle and noticed mention of the order in which
say takeValuesFromRequest tries to find available setters/getters or
instance variables. They list this order:
SETTERS:
1. public void setKey()
2. private _setKey()
3. _key
4. key
GETTERS:
1. public [...] getKey()
2. public [...] key()
3. private [...] _getKey()
4. private [...] key()
5. [...] _key
6. [...] key
So my question is this. Is there any performance benefit to using the
standard JavaBeans setter/getter methods since they are the first in
the chain of lookups? Not having access to the source of how WO does
this and not being hugely familiar with Reflection (which is what I'm
guessing WO uses internally to make this decision), it seems that would
be the case. But being new to WO I'm not sure. The reason I'm even
asking is that EOModeler doesn't allow you to choose how you want the
source generated. It only outputs:
key() // getter
setKey() // setter
for the generated Java class file.
Not a huge deal but would rather ( if there is a performance hit to
using method calls that are lower in the chain) just get in the habit
of rewriting out methods using the JavaBeans standard and also to
"always" create setter/getters in WOBuilder. It seems like most of
the books I have don't advise you to select the setter/getter
auto-generation for instance variables when adding them to the example
code that is being shown. It's always shown as optional.
Thanks for any insight.
Mike
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.