Suppose I have the following classes in a library
public abstract class HiddenBaseClass
{
//stuff
}
public abstract class ClassA : HiddenBaseClass
{
//stuff
}
public abstract class ClassB : HiddenBaseClass
{
//stuff
}
I want to prevent HiddenBaseClass
from being inherited outside the library, but I do want ClassA
and ClassB
to be inherited.
I cannot make HiddenBaseClass
an internal class
, because that would mean HiddenBaseClass
is less accessible than ClassA
and ClassB
.
Is there a way around this?
ClassA
, then you also inherit fromHiddenBaseClass
, so your requirements are in conflict. What problems does inheriting fromHiddenBaseClass
cause that you want to avoid?ClassA
andClassB
, but I also have no reason to designHiddenBaseClass
in such a way to support being inherited by the user.