I'm coding up a relatively simple search of a catalogue of products. Nothing amazing, but based off a simple inventory system of product/category/price/description/etc.
I have a class called "Product" that represents a product - and a class called "SearchItem" which extends Product and adds a "match" field (rating of the match against the text used to search).
Populating this class per item is easy enough, nothing amazing there...
But I want to make a class that contains all the results, which is then sortable and so on - rather than re-querying the database, etc.
Question
+Dick Montage Subscriber²
I'm coding up a relatively simple search of a catalogue of products. Nothing amazing, but based off a simple inventory system of product/category/price/description/etc.
I have a class called "Product" that represents a product - and a class called "SearchItem" which extends Product and adds a "match" field (rating of the match against the text used to search).
Populating this class per item is easy enough, nothing amazing there...
But I want to make a class that contains all the results, which is then sortable and so on - rather than re-querying the database, etc.
I appreciate any suggestions here.
Thanks you :)
Link to comment
Share on other sites
11 answers to this question
Recommended Posts