Business Validation Logic Code Smell

后端 未结 14 1129
醉酒成梦
醉酒成梦 2021-01-17 17:54

Consider the following code:

partial class OurBusinessObject {
    partial void OnOurPropertyChanged() {
        if(ValidateOurProperty(this.OurProperty) ==          


        
14条回答
  •  太阳男子
    2021-01-17 18:21

    Furthermore, why in the world is this partial? Using partial classes for anything but a generated code framework is itself is a codesmell since you're likely using them to hide complexity which should be split up anyways!

提交回复
热议问题