Opened 7 years ago

Last modified 7 years ago

#273 new defect

Don't use late binding for scoring formulas

Reported by: Phil de Joux Owned by: Joerg Ewald
Priority: major Milestone:
Component: FsComp Version: 2013
Keywords: Cc:


The use of late binding to load scoring formulas will get in the way of refactoring because the compiler and other tools will not see coupling that is only made at runtime and so will think items are unreferenced. Even if this is only a temporary measure, avoid the use of assembly probing and reflection to access the scoring formulas.

Directory.GetFiles?(Application.StartupPath?, "FsSf_*.dll", ...);

Furthermore, if FAI/CIVL are concerned about the veracity of a scoring formula, then compile time checking would be better too than allowing any scoring formula to be loaded at runtime.

Should we wish to go back to late binding, then we can do this after refactoring.

Change History (1)

comment:1 Changed 7 years ago by Joerg Ewald

Phil, this is a good observation, but I think it needs a bit more discussion.

I agree that late binding and coupling by a simple naming convention is not very good practice. But: The late binding mechanism in place today enables a very user-friendly handling of different scoring formulas. There are several around, and all people have to do is put the corresponding DLL into the installation directory, the rest is done by the application.

There are two use cases for this currently:

  1. Installing formulas from the Legacy Scoring Formula Package.
  2. When I create one-off formulas for testing out new scoring features

An alternative here would be to maintain a list of installed formulas, but that would already be an additional step for users.

For the future, the plan is to provide a Formula Development Kit of sorts, so that people with programming knowledge can create their own formulas for task and competition scoring. This will also require some kind of mechanism for these formulas to be recognized, offered as an option, and used if selected.

Note: See TracTickets for help on using tickets.