D
Darren
How would you force a derived class to implement a static method?
Darren said:How would you force a derived class to implement a static method?
Darren said:In my case I don't need to use it polymorphically I just need to enforce an
implementation of a static method.
I've read through some of the previous posts and they all seem to degenerate
from the problem at hand.
I think it's a genuine concern, along with enforcing specific
constructors, but C# and .NET definitely don't have any way of doing it
at the moment. It's *usually* better designed around (with factories or
whatever) but there are a few cases where it's a genuine problem![]()
Alexander Shirshov said:...
Do you have an example handy? I'd like to see it. I keep seeing people
asking about how to do that, but never saw an interesting real world
example.
David Lei said:You can use Interface to force all classes to have the same set of methods.