[rules-users] Re: Can I reuse eval output?

Arjun Dhar dhar_ar at yahoo.com
Wed Dec 12 05:56:36 EST 2007


> > evals by reusing their output?
> >   
> no
> > Another question is, is tehre something wrong in the above definition from 
a 
> > declarative programming point of view?
> >   
> its not idea - but sometimes over use of eval can't be helped - only you 
> know the answer to that, being your domain model expert.

Well, then the optimal way is to Pre-Evaluate it in the code and assert that 
variable as a Fact. But I dont think this is great from a declarative 
programming point of view.

Actually in decision table, a condition will be repeated "Row" number of times. 
So in the condition if an eval() is used; that eval is used "Row" number of 
times (though prasctically dependson other conditions, if at runtime how many 
times the eval will be used), but still it is inefficient.

I think it is important to maintain discipline when writing declarative 
staements, and should try and rely less on the code for efficient solutions.
I guess I have no choice in this case.

Thanks for you reply.




More information about the rules-users mailing list