473,511 Members | 17,486 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

single instance base class

I want to have a single instance of a base class that all the child classes
inherits from.
The base class is going load data from text files and this only needs to be
done once.
What I don't need is every time a child class is created that it goes out
and creates another instance of the base class, which then would go out and
load data from those text files.

Am I making sence here?
How can I do this in VB.Net?

Thanks

Mike w.
Nov 21 '05 #1
2 1511
Hi,

Added shared members to your class.
http://msdn.microsoft.com/library/de...akeyShared.asp

Ken
--------------------
"mike w." <mi***@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
I want to have a single instance of a base class that all the child classes
inherits from.
The base class is going load data from text files and this only needs to be
done once.
What I don't need is every time a child class is created that it goes out
and creates another instance of the base class, which then would go out and
load data from those text files.

Am I making sence here?
How can I do this in VB.Net?

Thanks

Mike w.
Nov 21 '05 #2
Hi,

Added shared members to your class.
http://msdn.microsoft.com/library/de...akeyShared.asp

Ken
--------------------
"mike w." <mi***@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
I want to have a single instance of a base class that all the child classes
inherits from.
The base class is going load data from text files and this only needs to be
done once.
What I don't need is every time a child class is created that it goes out
and creates another instance of the base class, which then would go out and
load data from those text files.

Am I making sence here?
How can I do this in VB.Net?

Thanks

Mike w.
Nov 21 '05 #3

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

Similar topics

14
3302
by: Sridhar R | last post by:
Consider the code below, class Base(object): pass class Derived(object): def __new__(cls, *args, **kwds): # some_factory returns an instance of Base # and I have to derive from this...
6
6652
by: Microsoft | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
7
6596
by: Baski | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
0
269
by: mike w. | last post by:
I want to have a single instance of a base class that all the child classes inherits from. The base class is going load data from text files and this only needs to be done once. What I don't need...
4
1631
by: Joe HM | last post by:
Hello - I have a Base Class where I want a New() implemented that can be called from the outside. This New() should create an instance of the appropriate cDerivedX Class ... The following...
5
1458
by: Russell Warren | last post by:
I just ran across a case which seems like an odd exception to either what I understand as the "normal" variable lookup scheme in an instance/object heirarchy, or to the rules regarding variable...
8
1660
by: Lou Pecora | last post by:
I've been scanning Python in a Nutshell, but this seems to be either undoable or so subtle that I don't know how to do it. I want to subclass a base class that is returned from a Standard Library...
2
2179
by: awryavari | last post by:
Hello All, I have case where I create one instance of a class "Base" and there are various other child objects that I need to create ("Derived" from "Base"). Is there a pattern where I could...
2
5485
by: Mesan | last post by:
Hello everyone, Thanks to many useful posts in this newsgroup and others, I've been able to come very close to something I've been wanting to do for a very long time. I've figured out how to...
0
7245
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
7144
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...
1
7085
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
7512
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
5671
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
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.