Implementing a similar type of -Stackoverflow is actually much simpler than you described, based on a bit of information that the command discarded every time after a while.
In the database, you simply save a collection of BadgeID - UserID to track who has it (and a counter or rowID to allow multiple rewards for some badges).
The application has a work object for each type of icon. The object is in the cache, and when the cache expires, the worker runs his own logic to determine who should receive the icon and make updates, and then he inserts himself into the cache again:
public abstract class BadgeJob { protected BadgeJob() {
And specific implementation:
public class CommenterBadge : BadgeJob { public CommenterBadge() : base() { } protected override void AwardBadges() {
Rex M Jul 01 '10 at 23:52 2010-07-01 23:52
source share