中国开发网: 论坛: 我爱学英语: 贴子 628270
sealw: 每日一句
Before we delve into why this area is such a disaster, let’s first take a brief detour into history. Once upon a time, there was the Java exception mechanism. Said mechanism allowed us to merrily toss up exceptions when things went wrong. In the same playground, we also had this idea of objectoriented code, whereby we split things up into different tiers, depending on what they do. So one tier calls down to the next, which is lower level, and so on. Each layer has a contract between it and the others above and below, and part of this contract is error handling.

在我们深入讨论为什么这个领域如此灾难深重之前,让我们先简要回顾一下历史。很久很久以前,就有了Java异常机制。当事情不对的时候,这种机制让我们快乐地抛出异常。同时,我们也掌握了面向对象编程的思想,我们根据工作的内容,把它们分解到不同的层中。这样一层会调用下一层,后者是较低的层,如此等等。每个层和它上下的层之间都有一个契约,这个契约的一部分就是错误处理。

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录