locked
Write only properties.. RRS feed

  • General discussion

  •     hi

    i am using write only properties in my class to expose private member which sets its value.

    when i run FxCop code analysis tool then it tells that "Do not use write only fields" as wrong design pattern.

    has anyone idea why this is a bad coding practice and what is alternate way to obtain the same behavior.

    thanks in advance.

    reagrds,
    chandan mahajan

    chandan mahajan
    Tuesday, February 10, 2009 8:30 AM

All replies

  • Hi Chandan,

    I have also questions about this rule. What is the design problem with write only properties?

    If anyone could explain the real drawback or why it is better to use void SetPropertyData(string data) I would be happy.

    Best regards
    Yannik

    Saturday, January 22, 2011 1:52 PM