Dirk,
Supporting Maps is not that hard, but the syntax and infrastructure
for that needs to be well thought and designed, cause once it is
released and is in production, changing it would mean to break backward
compatibility. So, it is in development a parser/compiler for that as we
speak. Next release (3.2) will support that.
Regarding apache dynabeans, there was a discussion about that a
couple weeks ago. The problem is that dynabeans does not allow (AFAIK)
you to define the generated class name. It means, you would not be able
to dynamically generate a "xxx.yyy.Person" class and then write a rule
using it:
rule "aaa"
Person(<constraints>)
Cheese(<constraints>)
then
// do stuff
end
You would be forced instead to write all your rules using DynaBean type:
rule "aaa"
DynaBean(<constraints>)
DynaBean(<constraints>)
then
// do stuff
end
Besides losing some legibility on the rules, you would also kill
performance as all facts would be flowing through a single
ObjectTypeNode in the network.
Having said that, there are alternatives available. I wrote a very
simple API (4 classes actually) to dynamically generate beans using ASM.
This beans are real world classes and can be dynamically
generated/loaded into the engine and at the same time allow you to write
rules in a simple way. I will do some code cleanup in them and publish
to those needing that solution.
[]s
Edson
Dirk Bergstrom wrote:
Beto wrote:
The question is: Is there a
way to write rules about dynamic properties?
I have a similar problem, and I solved it by writing Perl code to generate
Java source for a bean. It sounds clunky, but since I'm working with data
that's only accessible via a Perl API, it works out well. I won't need to
change the fields on the fly, so I can get away with this. If I need to go to
something more real time, I could use a custom classloader for the beans.
If support for Maps is too hard, the developers might consider supporting the
Apache commons dynabean standard.
--
---
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com
IT executives: Red Hat still #1 for value
http://www.redhat.com/promo/vendor/
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email