Why do the wrapper objects use abstract classes instead of interfaces? #803
Answered
by
jbogard
tacosontitan
asked this question in
Q&A
-
Currently, all three of the wrapper files contain abstract definitions and a corresponding implementation such as: public abstract class SampleWrapper {
public abstract void HelloWorld();
}
public class SampleWrapperImpl : SampleWrapper {
public override void HelloWorld() =>
Console.WriteLine("Hello world!");
} This could have been an interface and default implementation instead such as: public interface ISampleWrapper {
void HelloWorld();
}
public class SampleWrapper : ISampleWrapper {
public void HelloWorld() =>
Console.WriteLine("Hello world!");
} What was the driving factor to use an abstract class over an interface when no partial implementations were provided? |
Beta Was this translation helpful? Give feedback.
Answered by
jbogard
Nov 28, 2022
Replies: 1 comment
-
Those wrapper classes are there to bridge the generics divide. That's all. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tacosontitan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Those wrapper classes are there to bridge the generics divide. That's all.