[rules-users] IllegalAccessError in shadow classes

Mark Proctor mproctor at codehaus.org
Wed Feb 20 18:57:00 EST 2008


Godmar Back wrote:
> I think that you *should* treat facts that implement java.util.Map
> differently from other facts.
> Ignore their concrete class and don't worry about applying your
> shadowing algorithm.
> Then, treat them as if they were beans with getXYZ() methods for each
> key "XYZ" they contain.
>
> Your reply indicates that you haven't even considered this design. I
> wonder why not?  (It seemed so natural to me that I assumed it's what
> Drools *must* do. Especially considering the fact that Drools's chosen
> scripting language, MVEL, supports accesses to maps using a special,
> javascript-like syntax that allows you to verify that accesses are
> side-effect free.)
>   
It has been considered as MVEL allows you to use a map just like a pojo:
person = new HashMap();
person.name = "mark"

however as my previous email said we have been looking at solving this 
problem with a more encompassing problem of ontology support.

That said we are working towards making models pluggable. So that you 
could build in direct support for Maps as first class objects, although 
you would still lose object type descrimination. And ofcourse you would 
not get any tooling or sugar with this, as per my facttemplate issue of 
having to use person.setField( "name", "Godmar" )
> On Wed, Feb 20, 2008 at 4:11 PM, Edson Tirelli <tirelli at post.com> wrote:
>   
>>     A blog I wrote a long time ago about dynamically generated beans:
>>
>> http://blog.athico.com/2006/12/dynamically-generated-class-beans-as.html
>>
>>     
>
> I'm aware that I can generate beans - dynamically or statically, but
> that is exactly the hassle I had hoped to avoid. (And, quite frankly,
> it's not something I should have to go through when using a framework
> such as Drools.)
>
> Will the issue disappear in a future, shadowless version of your
> engine? To what degree will this version depend on facts being
> conforming Java beans?
>
>  - Godmar
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080220/38b6d8c7/attachment.html 


More information about the rules-users mailing list