This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I'm facing a design issue which I would like to get some suggestions on. I'm developing a web app in which I would like to show different types of content say News, Articles and ... I want to let the user to prioritize the contents being shown to her. The type of contents shown to each user varies and there's a maximum entries to be shown on the page which can be modified by user. Now how can I specify how many entries of each content be shown to user based on it's priority. Any help would be appreciated.
Do you mean the objects in your results have some sort of values attached, and you wish to sort on those values?
Joined: Apr 04, 2008
Not just sort, but control the number of each object type based on their values in a way that "objects created <= total objects allowed".
Maybe an example could clarify a little: I want to show some news and articles on the web page. User has defined that she's more interested in news than articles and she don't want to see more than 10 entries every time page loads. Now there might be more than 100 entries for each News and Articles but I have to show only 10 in a way that user's preference is preserved and there's more news than articles. Now how can I do it when the types of content can grow in the future and the cap on the total entries varies too. Thanks for any kind suggestion.
Well, you have to track the user preferences too. You will needs some way for your users to set (and persist) her preferences. And your display code needs to fetch (and use) those preferences, in addition to fetching the news. No black magic here -- just more coding.