Java Reference
In-Depth Information
Figure 10.2: Registration confirmation page
To represent a user in the application, we'll use a simple User model
class:
Download email_19/src/stripesbook/model/User.java
package stripesbook.model;
public class User extends ModelBase {
private String firstName;
private String lastName;
private String username;
private String password;
private List<String> aliases;
/ * getters and setters... * /
}
With this class, we can identify users when they log in with their user-
name and password. The application uses the primary email as the
username and allows the user to create up to five aliases, which are dif-
ferent email addresses that point to the same account. That way, a user
can tell his buddies that his email address is dannyboy@stripesbook.org
but give potential business clients daniel.greene@stripesbook.org instead.
Once the user fills in all the fields and clicks the Continue button,
the application validates that the primary email isn't already taken
by another user. Of course, the password and confirm password must
match. If all is well, the next page of the registration process appears.
That next page depends on how many aliases the user has chosen. If the
user decided on zero aliases, the registration is complete, and we show
the confirmation page (Figure 10.2 ) . With one or more aliases, the next
page allows the user to enter those aliases, as shown in Figure 10.3 , on
the following page, and then we show the confirmation page.
We have several interesting features to implement for the registration
process, so let's get to work.
 
 
 
Search WWH ::




Custom Search