method inheritance question

  • Thread starter Thread starter Craig Buchanan
  • Start date Start date
C

Craig Buchanan

I have a class named "Generic" and a second class named "Specific" which
inherits from Generic. I would like to have a method in both classes named
"Deserialize". I would like to have code specific to each class in each
object's Deserialize method. The Deserialize method in the Generic class
should only be available to its children. Finally, the child's Deserialize
method should call the parent's Deserialize method prior to executing it own
instructions. How do I structure this? I don't think I've properly defined
the Subs. Here's what I have so far:

Class Generic
Protected Sub Deserialize()
End Sub
End Class

Class Specific
Inherits Generic
Private Sub Deserialize()
MyBase.Deserialize

'stuff here
End Sub
End Class

Thanks,

Craig Buchanan
 
something like...

Class Generic
Protected Overridable Sub Deserialize()
End Sub
End Class

Class Specific
Inherits Generic
Protected Overrides Sub Deserialize()
MyBase.Deserialize

'stuff here
End Sub
End Class
 
Back
Top