[rules-users] Declarative fact model or Java?

Davide Sottara dsotty at gmail.com
Fri Jan 20 06:43:58 EST 2012


Hi Steve, 
let me share my thoughts on this. 

You will probably want to use a Java model when it's already available :) Or
when you're using the rule engine to implement the business logic layer of
your application, processing data coming from an external source.

A DRL model, instead, is definitely recommended for "temporary" facts, or
data structures which are used by the rules to do their computations. 
The main problem with DRL fact classes is that they're quite cumbersome to
use outside the rule engine. On the other hand, you will be sure that the
declared types will correspond to an implementation fully compatible and
optimized for the rule engine.

Very roughly : if the rule engine is a component in a larger architecture,
use java classes. If you're building a rule-based application - i.e. DRL is
your programming language and Drools is your execution environment, go for
DRL.

As for mapping, we have added this very experimental feature lately:

http://blog.athico.com/2011/12/new-feature-spotlight-traits-part-1.html
http://blog.athico.com/2011/12/dynamic-typing-in-rules-traits-part-2.html

I have plans to use annotations to improve the mapping, avoiding the 1-1
correspondence between fields, so if you want to contribute, if only to the
specifications, let us know :)

Best
Davide

--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-Declarative-fact-model-or-Java-tp3675001p3675181.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list