Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
lorentz1518356dI managed to talk him out of the database table. 8 redundant source files eliminated.
-
Demolishun3505755dWhat does this look like in what language?
I was thinking of std::bind or something (in C++). Call function from list of functions. -
lorentz1518355d@Demolishun It's C#, so first a reference to the static class is obtained (probably through typeof) then the methods are called through runtime reflection methods such as Type.GetMethods(), MemberInfo.GetCustomAttributes(Type) and MethodInfo.Invoke(object, object[])
-
lorentz1518355dThe custom attribute is at least a class so the names and types of attribute metadata are the only thing in this system that's checked at compile time.
-
lorentz1518355d@Demolishun This is the garbage code I have to write now. All error conditions checked partly to highlight just how much the language could check for us if we just let it.
I didn't even add the logic for caching those goddamn XML files yet, that'll be tomorrow's struggle.
Related Rants
We need a list of functions with an associated string, keyed by a sequential int. Neither can change between program versions. In fact, any changes align perfectly to program versions.
The datastructure: a list of string and func with statically known parameters
The solution my PO insists on: a class with static methods that have an attribute for specifying the number, and a database table of number to string. Whenever you need to pass around the list, you pass around a Type object of the class.
rant
metaprogramming
fixtures for fixtures' sake.