Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access and Assign Methods for ASP.Net
Message
From
01/10/2006 18:46:46
 
 
To
01/10/2006 11:29:33
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01158443
Message ID:
01158461
Views:
25
>I was wondering if anyone had come up with a good methodology for implementing access and assign methods in .NET?

As Borislav has indicated, the approach is somewhat more standard in .NET using property accessors, routinely referred to as "getters" and "setters". In VFP, we originally had a "property". A value was set to or read from the property and as a VFP developer, we had no real control over that process. Eventually, Access and Assign methods were introduced into VFP whereupon we suddenly had the ability to control what was being written to and returned from our properties.

In fact, it was VFP that was late to the game on this. Property accessors had been around in other languages a long time before VFP was provided with Access and Assign methods.

Finally, it's not so much relative to ASP.Net. In .NET, you have member or "field" variables that can have differing scope eg., public or private. These member variables are very much like the original VFP property before Access and Assign methods were introduced. If the scope of the member field is private, they can only be referenced inside the class and not by clients of the class. However, if you want to provide controlled access to these member variables to clients of the class, they are generally wrapped by a public property and access to the private member variable is strictly controlled by the property "get" and "set" methods that can read from and store to a corresponding, usually private, class level member variable. So, this is a class level issue that occurs in .NET generally and is not restricted to ASP.Net specifically.

HTH
-=Gary
Previous
Reply
Map
View

Click here to load this message in the networking platform