473,499 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

method inheritance question

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
Nov 20 '05 #1
1 859
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

"Craig Buchanan" <so*****@somewhere.com> wrote in message
news:eF**************@TK2MSFTNGP09.phx.gbl...
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

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1503
by: Franz Steinhaeusler | last post by:
Hello, (in wxPython) I want to redirect the SetStatusText to an own method (change the text somewhat) and then call the SetStatusText of wx.Frame. But I have a little problem of...
9
1696
by: Paul Rubin | last post by:
I'm trying the super() function as described in Python Cookbook, 1st ed, p. 172 (Recipe 5.4). class A(object): def f(self): print 'A' class B(object): def f(self):
2
8016
by: Kapil Khosla | last post by:
Dear all, I am trying to underlying implementation of virtual functions in C++. The way I understand polymorphism is class Base { public: virtual int func(); };
8
1554
by: Nick | last post by:
I have the following code: var obj = {a:0, b:1, ...} function f() {...} obj.f = f // This will make a instance method? How to make a Class method for the class of obj? Or what's the...
10
3521
by: John Brock | last post by:
I have a base class with several derived classes (I'm writing in VB.NET). I want each derived class to have a unique class ID (a String), and I want the derived classes to inherit from the base...
4
11966
by: bonono | last post by:
Hi, Suppose my class definition is like this : class A: name = "A" @classmethod def foo(cls): cls.__super.foo()
2
2785
by: Jim Owen | last post by:
In the following code, as I understnad it, the resulting display would be "I am B", because I have overridden the constructor in B. However, what if what I really want to do is display "I am A"...
22
23312
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
6
2077
by: VR | last post by:
Hi, I read about Master Pages in ASP.Net 2.0 and after implementing some WinForms Visual Inheritance I tryed it with WebForms (let's say .aspx pages, my MasterPage does not have a form tag itself...
9
1563
by: VK | last post by:
<OT>I am finishing TransModal 0.1 so planning to move it from alpha to beta stage.<OT> Besides that I am planning to write an introductory to inheritance schema currently used in Javascript...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.