One of the things that I always wanted my forum app to do, in part because every other one does, and in part because I felt like it should, is change the "new post" indicator to not knew when you had viewed the topic. It sounds like something simple enough, right?
In many ways, it probably is, but in finally trying to add it in the app, there were a couple of problems I had on my mind. The first was the metric assload of data you'd generate when saving records with the user's ID, the topic ID and the time. Chances are pretty good that's going to generate thousands of new rows every day. The second thing I wasn't crazy about was wiring this up to six different sets of paging queries (the forum, recent, user posts, search, favorites, subscribed).
After talking to one of the database monkeys at work about using the WHERE IN clause, that sounded like a good plan, and he assured me it would probably perform pretty well. After all, you're checking for records in around 20 topics per page, so if indexed right, it should be fast enough.
What I already had right was the abstraction of choosing which icon to show on each of those pages through one abstract base class, so that part was easy. So I have a new class that figures out the status combination of the topics by taking the user object and the generic list collection of topics. So far so good. It looks like it's performing well.
I'm really happy with the solution, because the refactoring actually reduced the total code. I got to use an enum with the Flags attribute, which I've never done for some reason.
No comments yet.