State Machine Frameworks for .NET(.NET 的状态机框架)
问题描述
我的工作中有一个系统,它基本上是一个消息驱动的状态机.它接收各种类型的消息,根据消息查找一些上下文/状态,然后根据消息和当前状态决定要做什么.通常结果是一条消息被发送出系统.
We have a system at my work that is basically a message-driven state machine. It takes in a variety of types of messages, looks up some context/state based on the message, then decides what to do, based on the message and the current state. Normally the result is a message being sent out of the system.
是否有任何好的开源框架可以在 .NET 中实现状态机?我查看了最新版本的 Windows Workflow,它似乎是一个不错的选择;但是,我对默认的持久性机制(我们需要报告状态转换数据)、可测试性以及 WF 团队正在重新构建框架这一事实(据推测)存在一些担忧.
Are there any good open-source frameworks for implementing a state machine in .NET? I've looked into the latest release of Windows Workflow, and it seems like it would be a good option; however, I have some concerns about the default persistence mechanisms (we need to report off the state transition data), testability, and the fact that the WF team is re-architecting the framework as we speak (supposedly).
我正在考虑尝试实现一个普通的 GoF状态"模式,而不是 WF,并使用 Spring.NET 将所有内容连接在一起.有没有什么东西已经这样做了,或者类似的东西?
Instead of WF, I'm thinking of trying to implement a plain-old GoF "State" pattern, and using Spring.NET to wire everything together. Is there anything out there that already does this, or something similar?
推荐答案
根据您的具体要求,您可能会找到 状态机编译器 足以实现 GoF状态"模式.它可以生成 C# 以及可以使用 Graphviz 转换为多种图像格式的点.我在以前的项目中使用过它,发现它足以生成简单"状态机.我希望这有帮助.
Depending on your exact requirements you might find the State Machine Compiler is sufficient for implementing the GoF "State" pattern. It can generate C# as well as dot which can be transformed into several image formats using Graphviz. I've used it on a previous project and found it sufficient for generating a 'simple' state machine. I hope this helps.
这篇关于.NET 的状态机框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:.NET 的状态机框架
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 输入按键事件处理程序 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01