G
Guest
Hi
This question is based around VB.Net but could probably apply to c# or any
OOP language as well.
We found some old (ish) code in our code base and have been unable to decide
if it is pure genius or something else besides. As it stands we're leaning
towards something else but would welcome some outside comments.
The situation is.
We have a base class:
Public Class NewBase
Private _strName as String
Public Sub New
<constructor code here>
End Sub
Public ReadOnly Property Name() as String
Get
Return _strName
End Get
End Property
End Class
and we have an Interface:
Public Interface INewInterface
Public Readonly Property Name() as String
End Interface
What we have observed is a class that implements the interface and inherits
from the base class like so:
Public Class NewClass: Inherits NewBase
Implements INewInterface
Public Sub New()
MyBase.New()
End Sub
Public Shadows ReadOnly Property Name() as String Implements
INewInterface.Name
Get
Return MyBase.Name
End Get
End Property
End Class
The actual code found is more extensive but the example above indicates the
sort of code that has been written. As I said most of us here think that this
is rubbish, and fundementally wrong and amounts to nothing more then double
concentrated boiler-plating but there's always that nagging feeling that it
may just be genius and felt that an outside opinion would be helpful.
Just for the fun of it we have named it InterBase Inheritance
Sorry if this has been posted in the wrong group.
cheers
Rupert
This question is based around VB.Net but could probably apply to c# or any
OOP language as well.
We found some old (ish) code in our code base and have been unable to decide
if it is pure genius or something else besides. As it stands we're leaning
towards something else but would welcome some outside comments.
The situation is.
We have a base class:
Public Class NewBase
Private _strName as String
Public Sub New
<constructor code here>
End Sub
Public ReadOnly Property Name() as String
Get
Return _strName
End Get
End Property
End Class
and we have an Interface:
Public Interface INewInterface
Public Readonly Property Name() as String
End Interface
What we have observed is a class that implements the interface and inherits
from the base class like so:
Public Class NewClass: Inherits NewBase
Implements INewInterface
Public Sub New()
MyBase.New()
End Sub
Public Shadows ReadOnly Property Name() as String Implements
INewInterface.Name
Get
Return MyBase.Name
End Get
End Property
End Class
The actual code found is more extensive but the example above indicates the
sort of code that has been written. As I said most of us here think that this
is rubbish, and fundementally wrong and amounts to nothing more then double
concentrated boiler-plating but there's always that nagging feeling that it
may just be genius and felt that an outside opinion would be helpful.
Just for the fun of it we have named it InterBase Inheritance
Sorry if this has been posted in the wrong group.
cheers
Rupert