Geeks With Blogs

WinToolZone - Spelunking Microsoft Technologies
I work as a developer on the Common Language Runtime (CLR) team, specifically in the areas of exception handling and CLR hosting.

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Inside and Out... An attempt to understand technology better...

I have been working with Whidbey for some time now. Came across a post of Mr. Sanjay Vyas on controlling the access of getter/setters of properties. For the current .NET implementation, have a look at this post where he talks about the concerns.

In Whidbey, its now possible to have the setter of a property having a more restrictive access specifier than the getter. Here's an example:

public string QCode
     get { return m_QCode;}
     internal set { m_QCode = value; }

Thus, as obvious, the setter can be used only within the assembly having the class implementing this property. The external assemblies (typically your consumer code) will not be able to use the setter.

Whidbey is making things more simple.. isn't it :) ?

Posted on Wednesday, May 12, 2004 11:27 AM .NET Framework | Back to top

Comments on this post: Restrictive Property Accessors

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Gaurav Khanna | Powered by: