I am developing a new system and looking at a particular problem I am facing. I don't like my current solution, but not sure if there is another way of doing it.

A particular class is responsible for providing a grade for student results based upon the test type and the raw score that they achieved. It takes a student result instance and depending upon the test type, will return "Below Average", "Average" or "Above Average". Each test type has its own logic in determining what string to return; some of the algorithms take the students age into account, while others don't.

I need the users of the system to be able to change what algorithm applies to each test type (maths, english) so this setting obviously needs to persist in the datastore. So there is a 1 to 1 mapping between the exam type and the algorithm used.

My current solution stores the class name that contains the individual business logic for each type of grading and instantiate this from the name in the database. It works.

But, I don't really like this solution as I don't think the class names which are saved to the file system should be stored in the database. They are unlikely to change. I also need these settings to be different for different users of the system. For example, one school may have english marked against one algorithm, while another school uses a different algorithm.

Which leads me to have a couple of questions:

- What are the alternatives to having the class names stored in the database? Is it just a matter of deciding it belongs "better" than anywhere else (i.e. config files, directly in the code)... with none of the available options being pefect..