473,505 Members | 14,950 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scope of Shared Properties

Quick question:

If my page instantiates a class that has a protected shared property,
is that property shared across all instances of the class...even those
that I didn't instantiate, but another user accessing the page did?

Thanks!

Oct 30 '06 #1
1 1083
From my understanding of the shared descriptor in VB (I use C# mostly so I
may be a bit off), the shared property is never truly instantiated, it's
available directly whether the class is instantiated or not. Shared/static
members and properties should be able to be called without the class ever
being created. So yes, all the users who access this property should have
exactly the same value, which could lead to some very interesting results if
they are trying to write to it at the same time. An example of a shared
property for a class may be something like total number of users in a
membership system. All accounts will see the same total. Anytime a new
account is added and the shared property is incremented, all should see the
increment, but some locking should definitely be done when modifying this
value.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"daokfella" <jj******@hotmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Quick question:

If my page instantiates a class that has a protected shared property,
is that property shared across all instances of the class...even those
that I didn't instantiate, but another user accessing the page did?

Thanks!

Oct 30 '06 #2

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

Similar topics

6
2194
by: Hal Vaughan | last post by:
Being self taught, this is one thing I've always had trouble with -- I finally get it straight in one situation and I find I'm not sure about another. I have a class that keeps calling an...
2
1617
by: Don | last post by:
I'm asking this for a friend of mine, so forgive me if I'm getting some of the terminology wrong (I don't have any experience with ASP.NET). I've got an ASP application that has some classes that...
3
1382
by: Chris B. | last post by:
I'm getting some strange results in an asp.net web application that has recently gone live. In the header of almost all the pages, the full name of the currently logged in user is displayed. On...
6
1422
by: paul perrin | last post by:
I have a class I want to implement in VB.Net - but can't get the behaviour I want. There are two issues - one how should I be getting the behaviour I want, and second is there a better way...
2
1226
by: vvenk | last post by:
Hello: I am thinking of an object called "user." This object will be instatntiated during a login process. But I want to use this to control the behavior of the application since it will also...
3
1386
by: Rob | last post by:
Rather new to vb.net... I am wondering if the following is possible and sounds reasonable... Can connection objects and datasets be defined once (at program load) and be available for the life...
2
1453
by: mgoold2002 | last post by:
Hello. I've just begun programming in VB .NET, and I'm trying to turn all my modules into classes. In order to retrieve/exchange values from one class to another, I initiated New instances of the...
3
1373
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... At least by the group title, this seems like a question for dotnet.framework.aspnet.caching but that group seems pretty slow. I'm trying to sort things out with a co-worker. We've got...
3
2457
by: John Dann | last post by:
Trying to learn Python here, but getting tangled up with variable scope across functions, modules etc and associated problems. Can anyone advise please? Learning project is a GUI-based...
0
7216
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
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
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
7018
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
7471
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
4699
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
3187
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
1528
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
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.