How to avoid multiple nested IFs

前端 未结 6 601
情话喂你
情话喂你 2021-02-01 19:08

I am currently trying to restructure my program to be more OO and to better implement known patterns etc.

I have quite many nested IF-statements and want to get rid of t

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-01 19:37

    You way want to investigate C#4 code contracts.

    A pattern often used is DDD specification pattern for abstracting out if statements, although in your case its probably not suitable.

提交回复
热议问题