C
Chris Dunaway
I have a simple interface with two methods, MethodA, and MethodB.
I also have a class with implements the interface. The class provides
a full implementation for MethodA but for special reasons, provides
only a stub for MethodB, with no code in it.
The code that uses the interface needs to be able to tell if MethodB
has actually been implemented by the class. For example:
(pseudocode)
If MethodBHasCode Then
MyInterface.MethodB()
Endif
My questions:
1. Is there any attribute I can apply to the stubbed method in the
class so that I can see if it has actually been implemented?
2. Should I just call MethodB as if it had been implemented? Is there
any performance issues with calling an empty sub?
Thanks
I also have a class with implements the interface. The class provides
a full implementation for MethodA but for special reasons, provides
only a stub for MethodB, with no code in it.
The code that uses the interface needs to be able to tell if MethodB
has actually been implemented by the class. For example:
(pseudocode)
If MethodBHasCode Then
MyInterface.MethodB()
Endif
My questions:
1. Is there any attribute I can apply to the stubbed method in the
class so that I can see if it has actually been implemented?
2. Should I just call MethodB as if it had been implemented? Is there
any performance issues with calling an empty sub?
Thanks