TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Advise on building a Rules engine

1 点作者 famoreira将近 13 年前
I have a need to build an app (Ruby) that allows the user to select one or more patterns and in case those patterns are matched to proceed and complete a set of actions.<p>While doing my research I've discovered the new (to me) field of rules based systems and have spent some time reading about it and it seems exactly the kind of functionality I need.<p>The app will be integrated with different web services and would allow rules like these one:<p>When Highrise contact is added and Zendesk ticket is created do add email to database<p>I had two ideas to build this. The first is to build some kind os DSL to be able to specify the rule conditions and build them on the fly with the user input.<p>The second one is to build some rule classes each one having a pattern/matcher and action methods. The pattern would evaluate the expression and return true or false and the action would be executed if the match is positive.<p>The rules will then need to be persisted and then evaluated periodically.<p>Can anyone shed some light on this design or point somewhere where I can get more information on this?<p>Thanks

2 条评论

GuiA将近 13 年前
Why not use a Prolog backend to handle all of that? Starting to write your own DSL seems like a risky decision, especially if you're new to the field.
评论 #3975241 未加载
onetwothreefour将近 13 年前
Save a bunch of time and just use Drools.
评论 #3975246 未加载