图1通过我在事务策略系列中所使用的逻辑应用程序栈展示了High Concurrency事务策略。
Figure 1 illustrates the High Concurrency transaction strategy via the logical application stack I've used throughout the transaction strategies series.
现在我可以为pop方法编写行为,即确保当栈在逻辑上为空时,抛出一个异常。
Now I can code the behavior for the pop method, which ensures that if the stack is logically empty, an exception will be thrown.
在这种情况下,如果push没有被调用(或者从逻辑上讲,栈为空)的情况下确保pop抛出一个异常,则意味着栈有一个状态。
In this case, ensuring that pop throws an exception if push hasn't been called (or logically, if the stack is empty) means that the stack has a state.
应用推荐