Java Reference
In-Depth Information
Web service for use in a larger application. The requirements may include
industry-specific terminology with which the user is familiar and which,
therefore, must be included in the user interface. These requirements help the
programmer determine which technologies to use when designing a solution
to the problem. For larger problems, the analysis also should include an initial
breakdown of the problem into smaller problems so that programmers can
develop solutions gradually and in smaller, more manageable pieces.
The requirements for the Shipping Charge Calculator shown in Figure 1-10
on page 13 specify the input data that should be entered by the user and the
algorithm that must be used to calculate the output data. The requirements also
explain how users will interact with the program, including the rules that govern
valid and invalid input data entered by the user. The end result of the analyze
requirements phase is that both the user and the programmer agree in writing
that the requirements for the program are clear and complete. At this point, the
programmer can begin to design a solution, and the user can begin designing
tests to verify that the solution satisfies the program's requirements.
Design the Solution — Phase 2
Designing a program solution usually involves developing a logical model
that illustrates the sequence of steps you will take to solve the problem. Program-
mers use many tools to think algorithmically and to design their programs
correctly and efficiently. Programmers use storyboards, class diagrams, flow-
charts, and pseudocode to outline the logic of the program.
STORYBOARDS Because Java often is used to create windowed applications
or applets used in Web pages, programmers often create a storyboard , or hand-
drawn sketch, of how the application window or applet will look and where the
user interface elements will be placed in the window. A storyboard also can serve
as a reference for the logical names of these elements as you code your program.
The Shipping Charge Calculator may use a similar user interface for both a
windowed application and an applet, as shown in the storyboard in Figure 1-12.
Although these interfaces may be programmed separately, the user interface is
similar, and the same storyboard is useful for both.
title bar
labels
input text box
output text box
button
button
FIGURE 1-12
 
Search WWH ::




Custom Search