Should a business rule violation throw an exception?

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

Should a business rule violation throw an exception?

14条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 04:54

    It depends on what the business rule is, IMO. I would venture to say "not usually" but I'd view it on a case-by-case basis. I don't think there is any one answer, as different business rules might warrant it while others might not.

提交回复
热议问题