Rule 01 only in the rarest of occasions should you use public fields in any
object..

It breaks the rules of encapsulation and data hiding,

It also does not allow any data validation entering the object.

I know it can be tedious writing properties for all fields but a good habit
to get into.

I wish visual studio had a feature to allow you to setup default properties
for fields like by displaying a tickbox or something.

Has anyone tried the create properties dialog box.  Its so useless, I wonder
why they didn't take it out in 2003.

Regards
Daniel

-----Original Message-----
From: Damien Guard [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 21 October 2003 11:36 p.m.
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Do properties need a 'holder' keyword?

>I find it is very common to have a private field that properties use to
hold there value, like
>get{return holder;}set{holder=value;}

If that's all you are doing in a property's methods then why not remove the
property and make the private field public?

[)amien

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

________________________________________

Caution:  The content of this email is confidential and may be legally
privileged.  If it is not intended for you, please email the sender
immediately and destroy the original message.  You may not copy, disclose or
use the contents of this message in any way.

Important: Employees of EziBuy Ltd are expressly required not to make any
offensive or defamatory statements and/or not to communicate offensive
material. Any such communication is contrary to company policy and outside
the scope of the employment of the individual concerned. EziBuy Ltd will
therefore not accept any liability in respect of such a communication, and
the employee responsible will be personally liable for any damages or other
liability arising.
________________________________________


===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to