Some reader favorites:
EJB fundamentals and session beans
Create a scrollable virtual desktop in Swing
Wizard API updated!
Tim Boudreau has released a new version of the Swing Wizard library (version 0.997) that fixes the WizardException bug reported in JavaWorld's recent Open Source Java Project profile. The article's examples have been reworked to test out the new, improved WizardException. Thanks, Tim, for this helpful fix!
Open Source Java Projects: The Wizard API
To make the searching feature ubiquitous in an application, the user interface components must be kept simple and lightweight, thereby making the search dialog easily portable across the application. Many applications provide query options based on specific attributes or a combination thereof. But in this scenario, users are constrained in their queries by the limited set of attributes presented to them on the search page. Plus, the addition of new attributes to a page makes searching less intuitive and, in some cases, clutters the search page. An example of a simple but extremely effective search UI can be found in Web searching. Extending such a concept to application searches is only logical and practical, and is the topic of this article's discussion.
This article presents a framework that can be used to develop search features modeled on Web searches. The framework simplifies the client code and is easily extensible in that implementations can extend the framework to provide various application-specific search features. A single application can contain several different implementations of this framework, each corresponding to a search by different business objects.
The framework enables the building of search functionality that accepts an arbitrary query string. The string could contain
words and/or phrases corresponding to attributes of a business object. The client interface to a search implementation in
its simplest form takes in a query string and returns a java.util.Collection of some arbitrary key objects as in the following method signature:
public Collection getKeys(String searchStr);
The key objects in the result set uniquely identify the business objects returned from the search execution and can then be used to retrieve other details of the business objects.
Search functionality in most applications allows only searching a business object by a few attributes. In database applications, this means only a few columns of a given table are used in query predicates, and often, for performance reasons, the table is indexed on these columns. The mechanism used to execute the search could vary from having separate queries for each attribute to building a complex query at runtime that includes all the predicates. Regardless of the querying functionality's mechanics, the fact remains that an attribute and a search string are matched at design time by mapping user interface fields to attributes.
In the proposed scheme, however, by providing a single string interface, the association between the search string and the search object's attribute has been eliminated. This begs the question: What attribute do I search against? One possible solution for overcoming this lost association is for the search string to query all the attributes with the expectation that one or more queries would return a result set. This would entail executing all the queries all the time.
| Subject | Replies |
Last post
|
|
By Anonymous |
5 |
05/16/08 06:28 AM
by Anonymous |
|
By Paul Browne |
0 |
07/23/07 06:01 AM
by Anonymous |
|
By ramesh_n |
1 |
03/02/06 11:53 AM
by ramesh_n |
|
By Mad |
0 |
03/29/05 04:44 AM
by Anonymous |
|
By JavaWorld
|
0 |
03/27/05 11:51 PM
by JavaWorld |
Free Download - 5 Minute Product Review. When slow equals Off: Manage the complexity of Web applications - Symphoniq
![]()
Free Download - 5 Minute Product Review. Realize the benefits of real user monitoring in less than an hour. - Symphoniq