选择哪种设计模式用于报警/警报系统 [英] Which design pattern to choose for alarm/alert system

查看:425
本文介绍了选择哪种设计模式用于报警/警报系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





- 我正在设计一个C ++服务器应用程序,它必须根据从各种来源收到的不同数据生成各种类型的警报。

- 服务器应用程序必须对每种数据类型应用特定的算法/验证以识别故障并生成故障警报/警报

- 一旦识别出故障,信息将被发送到客户端和登录数据库。



我应该选择哪种设计模式来实现警报/警报功能并执行后续操作,如发送/记录等?



请求专家提供建议。



谢谢。



我的尝试:



我打算使用州或州机器模式根据收到的数据更改状态并进行维护。



状态更改后,有一些算法可以应用于每种类型的警报来生成它。

Hi,

- I am designing a Server Application in C++ which has to generate various types of Alarms based on different data received from various sources.
- Server application has to apply specific algorithm/validation for each data type to identify the failure and generate Failure Alarm/Alert
- Once the failure is identified, the information will be sent to the clients and also logged in database.

Which Design pattern should i choose to implement Alarm/Alert functionality and perform subsequent action such sending/logging etc?

Requesting experts to provide suggestions.

Thank you.

What I have tried:

I am planning to use State or State machine pattern to change the Status based on the received data and maintain it.

After Status is changed, there are certain Algorithm to be applied for each type of Alarm to generate it.

推荐答案

这实际上取决于您的场景的完整细节,无论如何,策略 [ ^ ]模式可以考虑。
It really depends on the full details of your scenario, anyway, the Strategy[^] pattern could be taken into consideration.


这篇关于选择哪种设计模式用于报警/警报系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆