mardi 27 octobre 2015

Good pattern for grades with different grade systems

I'm making a system that has Exams that can be graded, but the catch is that they can be graded in different grading systems (like A, B, C, D... or percentages or the 12, 10, 7, 4, 02, 00 system we use in Denmark).

I will need some way of doing statistics on the grades, so they cannot simply be stored as Strings.

I want to be able to make new grading systems easily.

I was considering making a IGradeSystem interface and a Grade class (that references the IGradeSystem). That way I can simply make new implementations of the interface for new grade systems. But I don't know if this is a good way to do it.

Any pointers to what pattern I should be using? I'm sure there is a good/accepted way of doing this, and I prefer using patterns when there is one applicable.

Aucun commentaire:

Enregistrer un commentaire