Requires Free Membership to View
When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to keep you informed on recent service-oriented architecture (SOA) and SOA-related topics such as integration, governance, Web services, Cloud and more.
Hannah Smalltree, Editorial DirectorOne very handy mechanism that I have seen employed for this very situation is the use of value objects that implement a Sortable interface exposing a public method as follows:
public interface Sortable
{
int compare(Object object, String field);
}
The value objects also implement an interface identifying them
as able to import and export XML, such as the following:
public interface XMLCapable
{
public String toXML();
public void fromXML(String xml);
}
With the value objects implementing these interfaces, a
template engine such as JSP can sort the value objects on
whatever field is desired. The links in the HTML response can
target the host with a request to re-sort the columns.
This solution, of course, performs the sort before the template is rendered to the client's space. I believe you are on the right track by presuming JavaScript as the mechanism for a client-space solution.
This was first published in March 2003