Three-tier architecture and exceptions

前端 未结 3 455
挽巷
挽巷 2020-12-09 05:41

It\'s considered good practice to have an exception for each layer of application (i.e. PresentationException, ServiceException, PersistenceE

3条回答
  •  悲&欢浪女
    2020-12-09 06:15

    Yes, you should wrap those exceptions in any case, as your service layer clients would otherwise be forced to also deal with the database layer. This would make things overly complicated. Note that the bit of work required to be done in the service layer is meaningless small when compared to the work that would be required to deal with database exceptions in the layer above the service layer.

提交回复
热议问题