[rules-users] change "assert" to "insert"+ other changes

Mark Proctor mproctor at codehaus.org
Mon Jun 4 23:51:19 EDT 2007


I've had no further feedback on this, so I'm going to make this change 
as part of the next milestone release (this week) - these changes are 
considerable.

assert will change to insert
-avoid the constant keyword collision with "assert", most languages are 
seem to support this now
-will change in both the drl and working memory api

modify to become update
-instead of workingMemory.modify(FactHandle, Object) it will be 
workingMemory.update(FactHandle, Object), will change modify to update 
in drl.
-this method is now only used for ShadowFact objects, it's  a method to 
let the engine know that an external object has been updated and to 
update it's internal cache. and reprocess.
-avoid keyword collision in MVEL which has nice "modify" sugar now

insertObject, retractObject and updateObject to beome insert, retract 
and update
-the Object part seems superflous, might as well remove it, especially 
as we start to support none Object fact types
-drl and working memory api will now use the same method names.

added new WorkingMemory modifyRetract and modifyAssert methods
-allows for non shadow fact objects.
-When not using shadow facts (although will ofcourse work with shadow 
facts) you cannot call 'update', or what use to be called 'modify', 
because we need to know the "old" value of fields so we can retract the 
from the workign memory. The only safe way is to first retract the 
object and then assert it. However with the existing api this adds extra 
work and results in new fact handle. modifyRetract and modifyAssert can 
now be used together to "simulate" a modify on a none shadow fact object 
in two parts. First call modifyRetract, then change your field values, 
then call modifyAssert.
-MVEL has sugar to do: modify ( person ) { age += 1, location = "london" 
}, what actually happens here is it first calls modifyRetract then 
applies the setters and then calles modifyAssert.

Mark

Greg Barton wrote:
> I think it's a good idea, so ya, change to "insert"
>
> GreG
>
> --- Mark Proctor <mproctor at codehaus.org> wrote:
>
>   
>> We have been getting querries with regards to jdk
>> assert collision and 
>> jboss rules assert, for this reason we are thinking
>> of changing it to 
>> insert for 4.0. Further to that its causing language
>> integrations issues 
>> for us as we expand pluggeable dialects. For this
>> reason we are thinking 
>> of chaning assert to insert, this would be an api
>> change and a language 
>> level change. I'd thought I'd throw this out to the
>> community before we 
>> do it. This of course breaks backwards
>> compatability.
>>
>> Mark
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>>     
>
>
>
>        
> ____________________________________________________________________________________Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
> http://new.toolbar.yahoo.com/toolbar/features/norton/index.php
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070605/96a3176b/attachment.html 


More information about the rules-users mailing list