Should a business rule violation throw an exception?

后端 未结 14 1059
误落风尘
误落风尘 2021-02-04 04:18

Should a business rule violation throw an exception?

14条回答
  •  天命终不由人
    2021-02-04 05:03

    Throwing exceptions can be computationally intensive, they are outside of the norm. For example in .net you have performance counters that are incremented - that is a heavyweight acitivty and so not something you would want to do instead of a simple conditional.

提交回复
热议问题