Keep in mind that using these Declared Types in DRL will have an impact in high volume
systems. Each time a knowledge session is initialized, these classes are dynamically
loaded onto the class-path. This dynamic loading (and unloading) subjects your
knowledgesession to a large amount of garbage collection. As a result, if you have a high
volume processing system you could very quickly reach a heap exception due to insufficient
garbage collection. In real-time point processing this does not cause a problem, but in
high volume processing it could.
I have noticed that in my high-volume applications, anytime I use decalred types or DRL
functions, that my rules run about 20% slower than when I use the exact same code in my
JAVA system, and have Drools access them as imported functions, and types. (because they
are local to the app, Drools does not have to invoke the class loader on all these
objects, which does slow down processing time).
Keep in mind, I don't know the details of what drools is doing, but I have observed
behavior in the JVM via monitoring tools to support this claim at a basic level. So go
ahead and use declared types, but if you find yourself running into a bunch of weird
processing errors, it may be because of the declared types.
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of Esteban Aliverti
Sent: Monday, November 14, 2011 3:21 AM
To: Rules Users List
Subject: Re: [rules-users] programming classes to represent domain in Drools like
templates
If you don't want to define your model as Java classes you can define it in drl
syntax:
http://docs.jboss.org/drools/release/5.3.0.Final/drools-expert-docs/html_...
Best Regards,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
- Developer @
http://www.plugtree.com
- Blog @
http://ilesteban.wordpress.com
On Mon, Nov 14, 2011 at 12:06 PM, santiago carbonell
<scarbonell@ono.com<mailto:scarbonell@ono.com>> wrote:
Hi,
I'm new in drools and I'm doing some test with this fantastic engine. With
Drools, I've loaded a drl file with some rules and ran with drools engine
and works perfect, but I got to preset/programming some classes in Java
about the domain where rules worked.
I'd like to load this domain, this "classes" as a file, like drl files, but
insted of rules, I'd like to load classes, or domain, so I'd needn't to
preset/programming this classes in Java.
My question is how can I load this classes in some file, like drl files with
rules? Is like templates in clips.
Thanks
--
View this message in context:
http://drools.46999.n3.nabble.com/programming-classes-to-represent-domain...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users