Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting method in sub class
Message
From
25/03/2015 05:21:38
 
 
To
24/03/2015 15:57:28
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01617154
Message ID:
01617233
Views:
29
>>So when do you use the parent class implementation ?
>
>I am not sure I understand the question correctly.
>
>All overridable methods are called in the framework class. If the developer implements those methods in the client application, something will be executed.

So you could use interfaces to avoid reflection. Essentially something like this?:
Public Interface IInitializeWithRow
Function InitializeWithRow() As Boolean
End Interface

Public Class BaseClass
Public Function Operation() As Boolean
Dim theClass = TryCast(Me, IInitializeWithRow)
If theClass IsNot Nothing Then
Return theClass.InitializeWithRow()
Else
Return False
End If
End Function
End Class

Public Class ChildClass1
Inherits BaseClass
Implements IInitializeWithRow
Public Function InitializeWithRow() As Boolean Implements IInitializeWithRow.InitializeWithRow
Return True
End Function
End Class

Public Class ChildClass2
Inherits BaseClass
End Class

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform