开发者

generic container for exceptions

开发者 https://www.devze.com 2023-02-18 20:56 出处:网络
handling exceptions is important for code safety and to prevent undesired conditions as input for subsequent routines/algorithms. On 开发者_Go百科the other hand, tough, filling the code with try/catc

handling exceptions is important for code safety and to prevent undesired conditions as input for subsequent routines/algorithms. On 开发者_Go百科the other hand, tough, filling the code with try/catch/throw statements makes it less readable. Is there any programming technique that helps to avoid mixing exception handling and algorithm-related code?

Thanks,


Aspect Oriented Programming allows you to create advice's on e.g. how to handle exceptions globally.

See this MSDN Magazine article or this slideshow for more information.

AOP using Unity 2.0 is also a good example.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号