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 的状态机框架
基础教程推荐
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
