Click here to Skip to main content
15,882,924 members
Home / Discussions / C#
   

C#

 
GeneralRe: Diff. between properties and fields? Pin
leppie26-Oct-02 10:14
leppie26-Oct-02 10:14 
GeneralRe: Diff. between properties and fields? Pin
Daniel Turini26-Oct-02 10:18
Daniel Turini26-Oct-02 10:18 
GeneralRe: Diff. between properties and fields? Pin
Jon Rista26-Oct-02 13:50
Jon Rista26-Oct-02 13:50 
GeneralRe: Diff. between properties and fields? Pin
Brian Olej29-Oct-02 8:45
Brian Olej29-Oct-02 8:45 
GeneralRe: Diff. between properties and fields? Pin
Brian Olej26-Oct-02 10:25
Brian Olej26-Oct-02 10:25 
GeneralRe: Diff. between properties and fields? Pin
Kevin McFarlane27-Oct-02 4:56
Kevin McFarlane27-Oct-02 4:56 
GeneralRe: Diff. between properties and fields? Pin
leppie27-Oct-02 5:00
leppie27-Oct-02 5:00 
AnswerRe: Diff. between properties and fields? Pin
LongRange.Shooter28-Oct-02 10:46
LongRange.Shooter28-Oct-02 10:46 
If I understand the question correctly...this may give a good definition.

Property: This is exposed via public accessors (get/set) that allow a user to indirectly modify an internal variable. This process allows the developer to a) encapsulate the actual data b) include process against the data before it is set in the variable c) define that variable as read-only / write-only / read/write-capable.

Field: Directly exposes an internal variable as PUBLIC. This, to some extent, breaks encapsulation, does not keep control of the variable within the control of the object, and is not CLS Compliant. No process can be performed against the public property (such as security or business logic) and as such the value of the variable should be treated as suspect by the owning object.

Does this help?

---------------------------------------------
Once I thought I was wrong
but I was happy to discover that was a mistake.


Condor
GeneralRe: Diff. between properties and fields? Pin
Brian Olej29-Oct-02 8:46
Brian Olej29-Oct-02 8:46 
GeneralRe: Diff. between properties and fields? Pin
Senkwe Chanda31-Oct-02 2:22
Senkwe Chanda31-Oct-02 2:22 
GeneralRe: Diff. between properties and fields? Pin
LongRange.Shooter31-Oct-02 9:54
LongRange.Shooter31-Oct-02 9:54 
GeneralNamed pipes Pin
EricK726-Oct-02 9:39
sussEricK726-Oct-02 9:39 
GeneralRe: Named pipes Pin
Daniel Turini26-Oct-02 9:50
Daniel Turini26-Oct-02 9:50 
GeneralRe: Named pipes Pin
EricK729-Oct-02 5:26
sussEricK729-Oct-02 5:26 
QuestionHow can I . . . Pin
Venet25-Oct-02 23:43
Venet25-Oct-02 23:43 
AnswerRe: How can I . . . Pin
Stephane Rodriguez.26-Oct-02 0:31
Stephane Rodriguez.26-Oct-02 0:31 
GeneralRe: How can I . . . Pin
Venet26-Oct-02 1:04
Venet26-Oct-02 1:04 
GeneralRe: How can I . . . Pin
Stephane Rodriguez.26-Oct-02 2:26
Stephane Rodriguez.26-Oct-02 2:26 
GeneralRe: How can I . . . Pin
Venet26-Oct-02 2:33
Venet26-Oct-02 2:33 
AnswerRe: How can I . . . Pin
ian mariano28-Oct-02 4:38
ian mariano28-Oct-02 4:38 
GeneralRe: How can I . . . Pin
Venet31-Oct-02 5:40
Venet31-Oct-02 5:40 
QuestionHow to send message to a form in C#? Pin
Solmyr24-Oct-02 19:19
Solmyr24-Oct-02 19:19 
AnswerRe: How to send message to a form in C#? Pin
Stephane Rodriguez.24-Oct-02 21:56
Stephane Rodriguez.24-Oct-02 21:56 
GeneralRe: How to send message to a form in C#? Pin
Mazdak25-Oct-02 8:48
Mazdak25-Oct-02 8:48 
GeneralRe: How to send message to a form in C#? Pin
Tom Archer25-Oct-02 13:59
Tom Archer25-Oct-02 13:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.