I was thinking of adding some Achievements to our internal bug-tracking and time logging system. It's connected to an SQL Server back-end.
At first I thought that the system could be run on the database, using triggers to, for example, know when:
- you've logged 1000 hours
- created 1000 tickets
- closed your own ticket
- worked on a ticket that has been not touched in a while.
- etc (you know - database-ish things)
But then I realized that I would also want purely front-end achivements
- used the advanced search abiltiy
- sorted by a column
- reset settings to default
- searched 500 times
It seems like the logic of every achievement must be hand coded. Could anyone imagine an some sort of Achievements Rules Engine, that you for example create scripts for?
And how to store them? If the achievement is:
- change column sort order 50 times in one session
that would imply that every time they sort a listview column it updates the database.
Any thoughts on this Win32 application design problem? I don't think that the Gang of Four have an Achievements design pattern.
Note: It's a Win32 client application, not a web-site.
i definetly like the idea of an eventing system. Various actions the user takes can raise events through a single eventing object:
protected void TimeEntriesListView_ColumnSort(object sender, EventArgs e)
{
_globalListener.RaiseEvent(EventType.ListViewColumnSort, sender, e);
}
protected void TimeEntriesListView_ColumnDrag(object sender, EventArgs e)
{
_globalListener.RaiseEvent(EventType.ListViewColumnDrag, sender, e);
}
That object can then have logic added to it to decide which events it wants to count. But more reasonably, various event listeners can attached to the central event listener, and have their custom achievement logic.