Hani Suleiman wrote:
The reason is that it's easier to code client-code using exceptions. Instead of doing null-checks all the time you can write code that assume that certain settings are available, and then simply try/catch it in case it wasn't available.Looking over the *Configuration framework, it looks like keys that aren't found result in a IllegalArgumentException being thrown.Now, the DelegatingConfiguration goes through all configurations when trying to find any named property. This means that there are a *lot* of getString calls to each configuration, hence a lot of new exceptions being thrown and caught which is rather expensive. My question is, why was this done this way? Why not just use nulls or some other static marker object if we need to distinguish between 'the value is null' and 'I don't know anything about this value'?
That was the reason. Improving performance may be a more important factor though, so go ahead and change it if you want to. Just make sure that all calls to the conf. does proper null checking.
/Rickard
--
Rickard �berg
[EMAIL PROTECTED]
Senselogic
Got blog? I do. http://dreambean.com
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
