Methods of simplifying ugly nested if-else trees in C#

前端 未结 11 668
野性不改
野性不改 2021-02-02 04:23

Sometimes I\'m writing ugly if-else statements in C# 3.5; I\'m aware of some different approaches to simplifying that with table-driven development, class hierarchy, anonimous m

11条回答
  •  攒了一身酷
    2021-02-02 04:31

    In simple cases you should be able to get around with basic functional decomposition. For more complex scenarios I used Specification Pattern with great success.

提交回复
热议问题