I'm working on a verification framework, in which I'd like to do something along the lines of (pseudo below - just an example):
class VerificationBase
{
criticisms = set()
AddCriticism( *FuncRef* ): criticisms.add(FuncRef)
Execute(): for f in criticisms: [call f]
}
def CriticizeDatabaseConnections(): { //do stuff }
def CriticizeDatabaseSchemas(): { //do stuff }
def CriticizeNetworkSettings(): { //do stuff}
...
VerificationBase.AddCriticism(CriticizeDatabaseConnections())
VerificationBase.AddCriticism(CriticizeDatabaseSchemas())
VerificationBase.AddCriticism(CriticizeNetworkSettings())
VerificationBase.Execute()
What is this style called? I'm sure there are detailed docs around this, but I'm not even sure what to google other than 'call function by reference' -- even that doesn't produce the most helpful results.
How can I correctly accomplish the above example?