Email:   
Home
In This Issue
EasyPrint
Click here for the RSS feed's XML code. This is not a browser URL.
Using a reusable code approach to HTML select option lists, part IV (continued)

Consumers order their OptionListSource objects by name, and the factory uses the name to look up the configuration parameters specific to that named OptionListSource and uses those parameters to instantiate the object. The factory then completes its work by returning the fully configured OptionListSource back to the consumer.

To obtain an OptionListSource, a consumer would use something like the following code:

OptionListSource projectSource =
OptionListSourceFactory.getOptionListSource("projects");
OptionListSource customerSource =
OptionListSourceFactory.getOptionListSource("customers");

The fact that the "projects" source may be of a different class than the "customers" source really doesn't matter to the consumer, because the consumer is going to invoke the same methods in the same way for both objects, regardless of the specific class of the objects.

Now what?
Once again, we've made quite a jump from where we left off last time, but we're not done yet! Now that we have our little framework in a usable form, we could continue to add additional implementations such as an LdapOptionListSource or an XmlOptionListSource, but we've done more than enough of these to leave any other potential implementations up to those who need them. What we have not done, though, is take a look at what other potential uses we might have for our little framework beyond the purpose for which it was designed. That will be the focus of our next installment.

Product availability and resources
For more information on Echo Technogoly Group, Inc., visit http://www.teametg.com.

H1 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




[ Prev ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

EASY DEDICATED AND VIRTUAL DEDICATED SERVERS FOR AS LOW AS $67.99 PER MONTH
Customize and configure your own dedicated server. Simply choose one of our popular plans or select your own Linux or Windows server and plan options.

NO LONG WAITS. Server provisioned within hours.

Tap here now and be up and running with your own server tonight.

Copyright © 2008, ZATZ Publishing. All rights reserved worldwide.
Editor's Login