Switch cases maximum implementation?

前端 未结 7 1751
没有蜡笔的小新
没有蜡笔的小新 2021-01-19 12:27

I am using a single switch cases which will have more than 100 cases statement to be used. Are there any limit ?

The usage of cases are for the suggestions of my Aut

7条回答
  •  没有蜡笔的小新
    2021-01-19 13:01

    One possibel appraoch is to move/remodel that code to "Chain of Responsibility patter given that those switch statements are not simple return, some processing is involved on them and so on.

    I believe you dont have use case of Guava Ranges too (In other words you are having each case a descret one, not a common processing on two (more than one) case.

提交回复
热议问题