在开发新应用程序的过程中,我想知道动态(比如说“可编写脚本”)系统的最灵活的解决方案会是什么样子。
一般来说,我需要一个纯文本文件(例如 TXT 或 XML),其中定义触发器(在我的示例中是十六进制字符串)和相应的操作(打开窗口、执行 SQL 事务等)。我应该能够添加新条目而无需重新编译整个应用程序。
如您所见,这种方式实际上并不能编写脚本,但我需要一个解决方案来定义哪个输入会发生什么。
有人有这方面的经验吗?
During development of a new application, I was wondering how the most flexible solution of a dynamic, let's say ‘scriptable’, system would look like.
In general, I would need a file in plain text (e.g. TXT or XML) wherein I define a trigger (in my example a hex string) and a corresponding action (open a window, execute a SQL transaction, …). I should be able to add new entries without recompiling the whole application.
As you see, it's not really scriptable this way, but I need a solution to define what happens with which input.
Has anyone got some experience with this?
发布评论
评论(3)
您可以在 .NET 应用程序中使用多种脚本语言; IronPython 是一个明显的例子,但也可以使用其他示例 - 例如 javascript(与您的 .NET 对象对话;而不是在浏览器中)。其中之一可能在这里有一些应用?
There are various scripting languages you can use inside your .NET application; IronPython being one obvious example, but others are available - javascript for example (talking to your .NET objects; not in a browser). One of these might have some application here?
如果您只有简单的程序流程,则可以使用 Windows Workflow Foundation 规则引擎 。
功能
另请参阅
使用 Windows 工作流的快速而肮脏的规则引擎第 1 部分和 Part2
我第一次发现这个主题是在阅读德语杂志dotnetpro 10/2010 第 30 页“Die Rule-Engine aus .NET ohne Workflow benutzen”
If you have only simple program flow you can use Windows Workflow Foundation Rules Engine.
Features
See also
A quick and dirty Rules Engine using Windows Workflow Part1 and Part2
I first found this topic when reading the german languaged magazine dotnetpro 10/2010 on page 30 "Die Rule-Engine aus .NET ohne Workflow benutzen"
那么,您可以嵌入 .NET 语言,例如 IronPython 或可能的 Boo
Well you can embed a .NET language like IronPython or possibly Boo