I think the holy grail of such method invoker protection will
end up being incorporated into "Design by Contract" whenever they
implement it.

        This is similar to you wanting to say: users should not be able
to call private methods unless you happen to be some serialization
process... There is *always* some special need to peek behind
protection lines. What is needed is either a clean way of specifying
this or the current situation whereby accessibility modifiers are said
to be "suggestions" to the compiler to flag errors but there is
absolutely no guarantee of security implied. There are always ways
around it...

Gili

On Mon, 17 Jan 2005 22:59:40 -0800, Jonathan Locke wrote:

>
>btw i just ran into some code that was doing this:
>
>            RequestCycle cycle = RequestCycle.get();
>
>there should be no reason to do this in any normal situation.  
>RequestCycle.get() is a static method that does a ThreadLocal lookup.  
>this is very un-OO and ALSO less efficient than simply saying this:
>
>            final RequestCycle cycle = getRequestCycle();
>
>getRequestCycle() is a method in Component now which simply looks in the 
>Session for the RequestCycle being processed by the Session.  in this 
>case, not only is the method call nice and OO, but the expense isjust 
>following a couple of references to the Session and dereferencing the 
>variable.  in the first case, a potentially expensive hash lookup is 
>required in the ThreadLocal class.  what's more, this is a detail we 
>would rather not have exposed to the world.  i wish java had a way of 
>protecting that method so it couldn't be called from outside the wicket jar!
>
>
>
>-------------------------------------------------------
>The SF.Net email is sponsored by: Beat the post-holiday blues
>Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
>It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
>_______________________________________________
>Wicket-develop mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/wicket-develop
>




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to