[Mono-list] C# General Question...

Reggie Burnett rykr@bellsouth.net
Fri, 10 Jan 2003 21:58:55 -0600


The point of properties having get and set methods is to hide
potentially ugly details of getting and setting properties.  A good
example is SWF in the .Net framework itself.  Setting some properties on
a form cause the underlying HWND to be destroyed and recreated.

That being said, a deriving class can override the property if it needs
to provide another implementation of get/set or hide set altogether.

Reggie

> -----Original Message-----
> From: mono-list-admin@ximian.com [mailto:mono-list-admin@ximian.com]
On
> Behalf Of A Rafael D Teixeira
> Sent: Friday, January 10, 2003 8:56 PM
> To: erpeters@informationinplace.com; mono-list@ximian.com
> Subject: Re: [Mono-list] C# General Question...
> 
> I donīt agree as being an oversight, it is a best pratice: things with
> different accessibility MUST have different NAMES. just recode your
> snippet
> as:
> 
> class A {
>    protected int m_data = 1;
>    public int Data {
>       get { return m_data; }
>    }
> }
> 
> Cheers,
> 
> Rafael Teixeira
> Brazilian Polymath
> Mono, MonoQLE Hacker
> 
> 
> 
> 
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list