Interface should not have properties?

后端 未结 13 1018
攒了一身酷
攒了一身酷 2021-01-07 22:43

My office colleague told me today that is bad practice to use properties in interfaces. He red that in some MSDN article(s), which I couldn\'t find (well I was trying few ti

13条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-07 22:58

    I can see no reason not to have Properties as part of your Interface. How else would you implement access to data members? Get Methods and Set Methods instead of properties. That would be just plain ugly and so 1990's.

提交回复
热议问题