Java Reference
In-Depth Information
functionality, all of which is inherent within the password itself. That is, the
function of a password does not depend necessarily on the particular
application, but instead depends on the definition of what a password is.
It is worth noting that such a definition of a password does not depend on
or impact the user interface or how it is presented to the user. It is the function-
ality, not the presentation, which is encapsulated in the class. Consequently, the
Password class can be used in a variety of applications.
In addition to the Password class developed in this chapter, a small Java
program is provided to test the Password class once it is developed. This test
program, called the PasswordDemo program, will provide a user interface for
testing the Password class, to verify that the class works as required (Figure 9-1).
User clicks Add
password button
PasswordDemo
user interface
password added
User enters password
data into appropriate
text box
FIGURE 9-1a
User clicks Change
password button
FIGURE 9-1b
User clicks Use
password button
Yes
Valid
password?
No
FIGURE 9-1c
password changed
No
Valid
password?
password
has expired
Yes
FIGURE 9-1d
password invalid
Yes
Password has
expired?
FIGURE 9-1f
password verified
No
Password
expiring soon?
No
password verified,
but soon will expire
FIGURE 9-1e
Yes
FIGURE 9-1g
FIGURE 9-1
 
Search WWH ::




Custom Search