Re: [smartweb-devel] Static sign on auth module less understandable
Brought to you by:
rlogiacco
From: Gaetano P. <gpe...@sm...> - 2007-11-14 14:02:30
|
I disagree to your sentence "the following is the easyest thing boolean loggedin = !User.isGuest();" becuase it presumes u uses the auth module to know that this static method works with the current method executing user. If anyone retrieves a User object instance why he must ask to a static method if this User instance is Guest and not simply to the object ifself. And thermore why i must ask statically something that changes dinamically??? I'm so confused...as new deveoper approching smartweb framework... User user= ....retrieve a User instance... boolean logged = user.isGuest(); Roberto Lo Giacco-4 wrote: > > 2007/11/14, Gaetano Perrone <gpe...@sm...>: >> I'm doubtful about the static isGuest() method in User class: >> In my opinion a more elegant solution is a not static method declaration: >> >> User user = User.get(); >> boolean loggedin =!user.isGuest(); >> I'm waiting for your opinion... > > I think an additional non-static method could be added but I don't see > the need for it: if you want to know if a user is a guest you could > simply > > boolean loggedin = (User.get() != User.GUEST); > > but in my honest opinion the following is the easyest thing > > boolean loggedin = !User.isGuest(); > > as this form shortens the statement a lot and is a bit less error prone > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13746936 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |