473,569 Members | 2,536 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 1084
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******@hotma il.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.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
2201
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 internal method. If I define variables within the method, I would expect that they're new and clean each time I call the method. If I'm calling from...
2
1619
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 have shared members. How do I set it up so that each individual session uses a different "copy" of each shared class? Right now, every session...
3
1388
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 occasion, this changes to the name of some other user currently on the site. Needless to say, some find this disconcerting. The routines that...
6
1423
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 altogether? 1) How do I... I have two classes, one represents a 'data record', the other is a generic 'data field'.
2
1238
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 encapsulate the logged-in user's security profile. What is the best strategy for creating one such object? I initially thought of having a...
3
1392
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 of the program ? Posssible ? Bad idea ? Over simplistic ? Regarding Connections... I am not saying that the conncetion should be left open,...
2
1457
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 classes in each class where I needed to retrieve a property or method. I discovered that this reciprocal loading of class instances led to...
3
1383
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 some classes that implement some in-memory caches with static Hashtable members. My understanding is that a static Hashtable may be shared between...
3
2461
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 (wxPython) Python program that needs to access external data across a serial port. The first thing that I need the program to do when it starts up is to...
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2114
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 we have to send another system
0
938
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.