I have
public class ViewBaseBase : UserControl
Then I have
public class ViewBase<TPresenter, TIView> : ViewBaseBase
Which leads of course to
public class AView : ViewBase<ConcretePresenter, IView>
The reasoning goes, I’d like a non generic way to access ViewBase polymorphically without knowing TPresenter, TIView.
Does this look “wrong” to anyone? I don’t know, it works, it doesn’t seem to be causing me problems, but it feels “wrong” some how. Possibly it’s the ViewBaseBase name, I could probably use an interface instead, but actually I quite like having the UserControl inheritance at that level as all ViewBase must be a UserControl…
There’s not much you can do unless you have a non-generic absolute base class, if you wish to access this stuff polymorphically. You’ve also said that every
ViewBasemust be a UserControl, but that doesn’t mean you can’t use interfaces. Consider this:AView is now a
UserControland aIViewBase. I personally think this is cleaner.