Re: method lookup order performance benefit?
Re: method lookup order performance benefit?
- Subject: Re: method lookup order performance benefit?
- From: Chuck Hill <email@hidden>
- Date: Mon, 26 Apr 2004 09:11:27 -0700
As a newbie to WO you are totally wasting your time pursuing avenues of
performance optimizations like this. WO has been around a while. Some
very smart people have worked on it. I don't think there are many
optimizations left to do that are not very application specific. WO is
not like other tools. Ignore the infrastructure. Trust that is is
good - it is! Focus on solving the business problem. The
infrastructure was done years ago.
In the docs we trust (well, when we can find them). From
NSKeyValueCoding interface:
Note: The default implementations have significant performance
optimizations. To benefit from them, NSKeyValueCoding can be
implemented on a custom class as shown above by using the methods in
NSKeyValueCoding.DefaultImplementation, or if your class inherits from
a WebObjects class that implements NSKeyValueCoding, do not override
the inherited implementation. Using a custom implementation incurs
significant performance penalties.
Chuck
On Apr 26, 2004, at 7:20 AM, Michael Engelhart wrote:
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.
_______________________________________________
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.