M
mytchewbacca
I would like to create a base class that inherits List(of X) where X
would be determined by the class inheriting the base.
ie
Public MustInherit Class ListBase : Inherits List(Of ?)
Protected Sub common()
//This code would not be specific to the list type, as that
could be a problem
End Sub
End Class
Public Class Words : Inherits ListBase(Of String)
...
End Class
Public class Numers : Inherits ListBase(Of integer)
...
End Class
I realize there are ways around this but I was just wondering
1. Is this possible?
2. Would this be a poor design? If so, what would be the
recommended strategy?
C# or VB.net
would be determined by the class inheriting the base.
ie
Public MustInherit Class ListBase : Inherits List(Of ?)
Protected Sub common()
//This code would not be specific to the list type, as that
could be a problem
End Sub
End Class
Public Class Words : Inherits ListBase(Of String)
...
End Class
Public class Numers : Inherits ListBase(Of integer)
...
End Class
I realize there are ways around this but I was just wondering
1. Is this possible?
2. Would this be a poor design? If so, what would be the
recommended strategy?
C# or VB.net