|
|
Re: please ...
|
Posted: Dec 9, 2008 10:59 PM
|
|
> ok i study in university IT and programming and i > i programmig well in Oracle ad .Net and i know lettil > about Java
Perhaps you should post your questions on a .Net forum if that is your strength. You should probably pick a .Net framework to learn.
> > Yes i want regiser users..look i hava stockmarket websit > t and i want my members > to ask the assistant in websit to advice them by > chatting..
Draw your self out a Use Case for which to code against.
e.g.
Use Case/Spec for User Registration
User Fields:
User Name - mandatory Password - mandatory last date logged in - mandatory Authorization level - mandatory (this may not be necessary)
Process:
Display screen "Please fill out form for Registration"
User Name: Password: Confirm Password: Authorization Level: (must default to level 1 - lowest level)
1) Search database to make sure that user name does not exist in database at present. if it exists post page back to this same registration page with the message: "Error user name already in use"
else go to step 2
2) Make sure that password matches confirm password field before proceeding to save the entered user in the database. if password != confirmPassword post page back to this page with error message else go to step 3
3) Save User to database default last logged in to null or some other defined default.
Sequence diagrams are not really necessary for such a small Use Case.
Something like this will constitute your Registration Use Case and it shouldn't be complicated at all.
Your next step will be to code this use case - if I were you I would follow TDD.
E.g. write a test case to test a Service to Search for a User Pojo via his/her userName, after which you write the Service itself.
in a JUnit scenario it will be something to this effect:
public UserServiceTestCase extends TestCase {
public void getUserTestCase() {
UserService<User> service = UserService.getInstance();
service.save(new User("test1", "password", null, AuthMatrix.level1);
assertNull(service.getUser("test2"));
assertEquals(service.getUser("test1"), new User("test1", "password", null, AuthMatrix.level1);
}
// You should then actually code the UserService
}
Keep in mind this is a Java scenario not quite sure how .Net would handle this - I'm subjectively disinterested in M$oft crap.
Once again, this is one of several options to follow - depending on whether you find TDD useful or not.
Good luck.
|
|