-1

I have studied rule engine for a week, and the problem puzzled me for a long time. The view will be confirmed as below:

  1. Most of rule engines are written in Java, not C or C++
  2. Most of companies prefer to select rule engines written in Java, not C or C++
  3. Specification.As far as i know JSR-94 is a Java Specification Request for a Java Rule Engine API, and there is no specification about C++.
  4. Activity of community.Most of people are interest in product written in Java,such as ILog Jrules,Drools.

Sincerely I hope your answer.

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
虫子樱桃
  • 102
  • 6
  • Normally I'd vote this as a "not constructive" question, this does, however, have an excellent, constructive answer, so I vote NOT to close it. – Arafangion Jun 07 '12 at 05:48
  • General purpose rules engines use high level languages to describe their rules and performance is not a key concern. For low latency trading based rules engines, a high percentage is in C, C++ or even in FPGA, and you won't find open source ones. ;) – Peter Lawrey Jun 07 '12 at 07:49

1 Answers1

3

It's not that it's 'less useful'; it's just that the only specification that you found is a JSR - which is a Java Standards Request. Pretty much all that comes after this point is speculation and potification from my personal experience.

Fundamentally, business rule systems need to be adaptable over time. The reason for a specification is to allow you to drop in one rule system in place of another at run-time without recompiling the application. Java has a history in this regards - dropping in replacement/implementation code is part of the design. C++ code doesn't lead people to think that it can be used that way - they tend to think of a C++ application as a 'single blob', and thus it's not amenable to dropping in extra classes to deal with business rules.

I personally wrote a POS application in Delphi (Object Pascal) ~15 yhears ago. When I got around to implementing customizable business rules, I used PascalScript, which allowed customization at run-time. I would have never expected the users of the system to use a compiler to build their rule-sets so I used a scripting language which allowed significant dynamic change in the application at run-time.

To answer your points:

  1. Rule engines tend to be written in java over c++ because of the environment being used. If you found a C++ only company, I'm sure their rule engine would be in C++
  2. It's an environmental choice. If you're using java, then the rule engine would be in java, if you're using C++, then the rule engine would be in C++
  3. Yes, that's a specification. Java loves them specifications.
  4. Activity - This is a 'political' point - It's not about preferences it's about deployments.
Anya Shenanigans
  • 91,618
  • 3
  • 107
  • 122