Shared members and interfaces
I'm trying to figure out a way to use an interface or maybe a MustInherit class to make sure a derived class has a specific shared member. Interfaces only enforce instance members. MustInherit classes support shared members but without the Overrideable keyword.
Any ideas on how to make sure a derived class has a specific shared member? I'd rather not have the member be an instance member, but I will if this can't be done.
Re: Shared members and interfaces
The point of inheritance and overriding members is polymorphism and polymorphism only applies to instances. You don't call Shared members on instances so overriding Shared members serves no purpose.
For example, you should be able to create an OleDbConnection instance and an SqlConnection instance and pass them both to a method that expects a DbConnection object and call their Open and Close methods. That's the whole point. You don't call Shared members on instances of any class so what's the point of ensuring that a class has the same member as its base when there is no instance to cast as any type?