I apologize if this has been asked and answered already, but am trying to understand why I can't declare a method in a base class Shared MustOverride, so that my derived classes are required to implement their own specific implementation of the shared method. I would be happy to implement the base "object" as either a Class or an Interface. Is this contradictory to object-oriented design philosophies, or just something MS has chosen not to implement?
As a very simple example, I would like to have the following:
Public Mustinherit Class ThingFormatter
Public Class TypeAFormatter
Inherits ThingFormatter
Any help, or direction to appropriate resources would be greatly appreciated.
As a very simple example, I would like to have the following:
Public Mustinherit Class ThingFormatter
Public MustOverride SharedFunction GetFormattedData(ByVal theObject As ThingToFormat) As String
End ClassPublic Class TypeAFormatter
Inherits ThingFormatter
Public Overrides Shared Function GetFormattedData(ByVal theObject As ThingToFormat) As String
End Function
End Classreturn theObject.SomeMethodThatReturnsString().ToLower()
End Function
Any help, or direction to appropriate resources would be greatly appreciated.