Java Reference
In-Depth Information
CHALLENGE 17.4
Write down an argument supporting the decision to place each factory and its related
classes in a separate package. Alternatively, argue that another approach is superior.
Abstract Factories for Look-and-Feel
Different operating systems have different standards about the look-and-feel—that is, the
appearance and behavior—of user interface components. Java Swing comes with a platform-
independent look-and-feel, as well as the ability to mimic the look-and-feel standards for
Microsoft Windows and Motif. In application development, you can go well beyond these
standards in specifying a look-and-feel for your application suite.
User environments that maintain consistent standards look more professional and are easier to
use than systems that do not adhere to a standard. For example, you might want to standardize
button sizes, fonts, background and foreground colors, border widths, and many other
component attributes. Without a standard, user environments tend to take on an unpolished,
crazy-quilt look that is difficult to navigate.
To provide a standard look-and-feel, you can establish a package of standard component
classes. Figure 17.4 shows a user environment package for Oozinoz.
Figure 17.4. Oozinoz consistently uses subclasses of Swing components to achieve
a sharp, uniform look.
The current policy at Oozinoz requires developers to use these classes rather than
corresponding Swing components. This policy helps to standardize the look-and-feel of
Oozinoz applications. The problem may arise, however, that the business needs different
look-and-feels in different situations.
Search WWH ::




Custom Search