凯恩戈姆故障处理程序
根据 Cairngorm 架构,我们在每个服务的每个命令类中始终有一个故障处理程序。
我们如何创建一个类来处理所有服务的故障处理程序事件。
According to Cairngorm architecture, we always have a fault handler in every command class for each service.
How we can create a single Class for handling Fault handler event for all the services.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你所说的“总是有一个错误处理程序”是指契约吗?就像实现接口一样?
您可以编写一个所有其他命令类扩展的基命令类。基类可以实现错误处理程序,所有其他子类可以选择覆盖它。
By "always having a fault handler", do you mean by contract, as in in implementing an interface?
You can write a base command class that all of your other command classes extend. The base can implement the on fault handler and all other sub-classes can optionally override it.
创建一个基类,从中扩展所有其他类,并将故障处理程序放在那里。例如:
FaultHandlerCairngormCommand 扩展 SequenceCommand 实现 IResponder
[BaseCommand.as]
[MyCommand.as]
Create a base class that you extend all other classes from, put the fault handler there. Such as:
FaultHandlerCairngormCommand extends SequenceCommand implements IResponder
[BaseCommand.as]
[MyCommand.as]