|
|
|
|
|
|
|
|
|
|
|
|
|
|
Using a reusable code approach to HTML select option lists (continued)
So what have we done? We created a Java Interface, an abstract class, and a final class. But what have we really accomplished? We have created the foundation for producing any number of implementing classes to obtain option list data from any number of potential sources. And we have done it in a way that insulates the using applications from the actual source of the information. From the perspective of the using class, the method to obtain the possible values for any input field that can be supported by an HTML select statement will always be the same:
ArrayList myOptions = myOptionSource.getOptions();
|
For our specific implementation, we can instantiate our option source by passing our list as an argument to the constructor. For example, if we have a simple three-tier priority structure, the following line of code will create an OptionListSource to support it:
OptionListSource myOptionSource =
new SimpleOptionListSource("Low,Normal,High");
|
Now what? From this simple starting point, not only can we create additional implementing classes to obtain data from other sources, we can also begin to enhance our framework to add additional features and functions. For example, our simple framework assumes that input is required, or in other words, that you must select one of the options from the list. It also assumes that the data is static, or can be loaded once and reused without ever having to be refreshed from the persistent source. Next time, we'll take a look at growing our simple framework to add features and functions without disrupting any existing users that are already happy with the current version as it stands.
Product availability and resources For more information on Echo Technology Group, Inc., visit http://www.teametg.com.
Easy, flexible article reprints ZATZ now offers a quick, easy, flexible and inexpensive way to use article reprints in your marketing and promotion efforts. You can now get article reprints for a one-time fee of only $200. For details, visit http://mediakit.zatz.com/reprints.
|
Jeff Chilton is Vice President of Fulfillment at Echo Technology Group, Inc., an IT consulting firm that specializes in enterprise-focused best practices. He can be reached at jchilton@teametg.com.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.
Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.
Learn how to easily clean up your address book. |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|