On Tue, Jul 22, 2008 at 9:47 AM, Chris Chabot (JIRA) <[EMAIL PROTECTED]> wrote: > Really ? When people have to write their service classes, is it easier to > explain to them (and have them remember) isAnonymous() or that they should > check some variable and see if it's null?
If they are writing a service class and they need to know who the user is, they check the security token. If the security token isn't there, then the user isn't authenticated. It's really easy, and this is common practice in java land: http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html#getUserPrincipal() > Also is it easier to understand an exception that says "hey silly, you forgot > to check if this is an anonymous token" or a "*cloud of smoke and debugging > output* you referenced a null variable". The difference between IllegalArgumentException and NullPointerException is not huge, and in my humble opinion it is not worth the overhead of adding a new API to shindig. On the other hand, this is a fairly minor API, minor enough that t I'm going to stop fighting it. If I haven't convinced you with these arguments, I will go ahead and adapt to this API when it is added. I won't even gripe much. =) Cheers, Brian
