3rd Party Membership Project

Posts   
 
    
Wade
User
Posts: 76
Joined: 15-Jun-2004
# Posted on: 16-Jul-2004 19:26:15   

I developed this module to hopefully be a drop in to all my web projects that I want to have users and roles with security encryption of passwords. I am looking for feedback on the design, things that are missing, things that can be done in a better way. I am hoping the community will help take this project and improve upon it for all of our benefit.

Thanks, Wade

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39752
Joined: 17-Aug-2003
# Posted on: 16-Jul-2004 20:04:50   

The project is available in the 3rd party section in the customer area simple_smile

Note: perhaps a note about licensing of your code into other projects is good to add. After all, it's your code simple_smile

Updated the website note with your explanation here.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 497
Joined: 08-Apr-2004
# Posted on: 20-Jul-2004 23:01:13   

Thanks for this Wade simple_smile Will definately take a look when i'm not so busy ;-)

Wade
User
Posts: 76
Joined: 15-Jun-2004
# Posted on: 21-Jul-2004 03:39:56   

Thanks, please everyone take a look and give some feedback. I did run across one item I was not sure about after I sent it to Frans. That is in the Membership.ValidateUser().

  1. Should the TypedList be changed to return something different like a row count for a matching username and password? Or should it just throw the exception as it does now?

  2. If it does stay as throwing an exception in that method, should the exception be rethrown to the next level up the stack or should it just return FALSE to signify it as invalid? Basically, if someone takes the code as is and they do not put code in to handle the thrown exception then their application will crash.

Let me know what you all think.

Wade

jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 21-Jul-2004 07:08:14   

Wade wrote:

Thanks, please everyone take a look and give some feedback. I did run across one item I was not sure about after I sent it to Frans. That is in the Membership.ValidateUser().

  1. Should the TypedList be changed to return something different like a row count for a matching username and password? Or should it just throw the exception as it does now?

  2. If it does stay as throwing an exception in that method, should the exception be rethrown to the next level up the stack or should it just return FALSE to signify it as invalid? Basically, if someone takes the code as is and they do not put code in to handle the thrown exception then their application will crash.

Let me know what you all think.

Wade

Ummm...I haven't looked through the code myself but I will. In the meantime, I wouldn't think an exception should be thrown in this situation at all, except for "exceptional" situations. A person entering in an invalid username or password is not exceptional; It's a perfectly valid state. In this case I would throw an exception only if you got an error connecting to the db, or other such "exceptional" situations and then I would wrap it into a custom exception that explained the situation a bit better.

As for bubbling up the exception, as this is a service being consumed by any unknown code, it's reasonable to require them to put in exception handling as you need a mechanism to communicate that something has gone wrong. If they choose not to handle such situations that's their problem. However, again, I would wrap the exception and rethrow a custom one.

Just my .02 simple_smile

Jeff...