选择哪种设计模式用于报警/警报系统

编程入门 行业动态 更新时间:2024-10-25 04:23:47
本文介绍了选择哪种设计模式用于报警/警报系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

- 我正在设计一个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.

更多推荐

选择哪种设计模式用于报警/警报系统

本文发布于:2023-11-27 08:39:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637318.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:哪种   警报   模式   系统

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!