In this case, however, you have already modeled the IOrderManagement and callback service specifications, so you can delete the two that are created by the pattern.
然而,在这种情况下,您已经对IOrderManagement和回调服务规范建模了,因此您可以删除模式所创建的这两个内容。
So, let's create a trait that implements this pattern, then use it to handle callback behavior.
所以,让我们创建一个trait来实现这个模式,然后用它来处理回调行为。
When looking at the callback pattern from a Scala perspective what we actually see is a cumbersome implementation of a 'function'.
如果从Scala的视角来看待这种回调模式,我们发现里面充斥的全都是某个“函数”的繁琐实现。
应用推荐