I think you're making this more complex than it needs to be. I'm just trying to create a scenario where you're passing a generic function (getWeight) to a non-generic method (SumWeights).
Are you talking about IoC / DI? ;)
Edit: Now I remember! Your solution reminds me of Service locator pattern, which is BTW an anti-pattern. That's why I found it immediately wrong.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.