Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Design issues
Message
From
06/08/2010 03:05:41
 
 
To
05/08/2010 15:40:12
General information
Forum:
ASP.NET
Category:
Class design
Title:
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01475236
Message ID:
01475497
Views:
37
>An interface would be the simplest way to accomplish what you are looking for. All you need is the interface definition:
>
>Public Interface IParser
>    Function ParserGetContent(ByVal tnPrimaryKey As Integer) As String
>End Interface
>
>Then in your base class, add
Implements IParser
after the class definition, and change the type of oOriginator to IParser. Your existing classes would inherit the interface from the base class, and you can add the interface to any new classes that also need that method.

I may have mis-understood Michels requirements but I don't see how an interface would help. In the scenario he gave which classes should implement IParser?
It would be useful if he wanted to use a class that was not based on the Parser class to implement the ParseGetContent() method - but that is not the case. He wants to override the behaviour of ParseGetContent() in an existing instance of Parser (or one of its derived classes)

But question for Michel: If the GetPage() method knows which behaviour of ParseGetContent() should be used why not just instantiate the relevant sub-class to do the work ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform