|
-
Oct 23rd, 2003, 12:38 PM
#1
Thread Starter
Hyperactive Member
Do we use 'readonly' or 'writeonly' properties...
In the real world of vb.net, do we usually use 'Readonly' or 'Writelonly' properties at all?
thank you
nath
-
Oct 23rd, 2003, 12:51 PM
#2
I use Readonly properties a bit usually for Item properties that are collections and things I only want set in the constructor.
Last edited by Edneeis; Oct 23rd, 2003 at 02:19 PM.
-
Oct 23rd, 2003, 01:26 PM
#3
PowerPoster
I use readonly here every now and then. Most of the time it is both for my objects.
I haven't had much of a reason to make a write only property. I figure if the user can write to the property, why shouldn't they be able to see it later? They obviously knew it at one point....
-
Oct 23rd, 2003, 02:03 PM
#4
Frenzied Member
Read-only is about the only one of the two that I use...I have yet to find a significant reason to use write-only.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Oct 23rd, 2003, 03:10 PM
#5
PowerPoster
I extended the Infragistics UltraGrid control a few months back and exposed a readonly property called LastActiveRow. It's readonly in the sense that I only use a Getter, not the readonly keyword. I can't say I use them all the time, but they have their moments.
OFF TOPIC
Also, I finally had an opportuntiy to use operator overloading!!
In my forum system, a user can belong to multiple roles, where permissions can clash. I used bitmasking and operator overloading for my permissions engine. So now, I can do something like this:
Code:
// In my operator overload, I 'Or' together the bits
ForumPermission p = f.Permission + f2.Permission;
The whole thing is actually pretty solid and I plan on using it in future projects. If anyone would like to see the code, shoot me an email.
Last edited by Lethal; Oct 23rd, 2003 at 03:16 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|