I have always believed that my greatest successes and most elegant solutions in programming come from sheer laziness. During my most recent project (Slatwall, an e-Commerce platform) I was challenged with developing a simple way to display a product listing that can be manipulated in four major ways:
1) Filter by an Attribute (Show only X Brand)
2) Set up a Range on an Attribute (Show Items that are Between X and Y Price)
3) Order the Listing (Sort By Highest Ranking)
4) Search Specified columns for Keywords
After further review, I realized that what I needed to do wasn't just relevant to product listings, but that these four key tasks were a common necessity of most data driven application. In addition these organizations of the data need to be achieved using the Url Query String, so that once a dataset is organized, filtered & search on... the end record set can be save and re-accessed very easily.
Adding an additional level of complexity was that the e-Commerce platform was designed so that any business could use it. What that meant was that each business was going to have very specific needs as far which data columns are in their product listings and how they want to organize, search & filter their data.
And thus, the queryOrganizer was born. The idea being that we provide a simple format and some naming conventions that would enable this to be done on any type of query. I won't go into the details here, but if you are interested more in how it works please visit the wiki here on http://wiki.github.com/gregmoser/queryOrganizer/
Hopefully this Open Source ColdFusion component will help you in your next project.