[rules-users] Advantages and Disadvantages of "from"

Thalupula Ravi thalupularavi at gmail.com
Fri May 30 12:17:34 EDT 2008


 Hi Marcus,

  Again thanks for your information. Appreciate your help.

 Regards,
 Ravi T


Marcus Ilgner wrote:
> 
> Hi,
> 
> 
> On Fri, May 30, 2008 at 5:06 PM, Thalupula Ravi <thalupularavi at gmail.com>
> wrote:
>>
>> Hi,
>>
>> Can some one describe about advantages and disadvantages of below to
>> approaches
>>
>> 1. Interacting Database for information in rule ( using "from" or
>> something
>> else)?
>>
>> or
>>
>> 2. Required information supplied to rules in the form facts at one shot
>> by
>> client instead of again hitting the database.
>>
>> Thanks for your help:handshake:
> 
> if you're going to use "from" in your rules, you should make sure that
> you provide some extra methods in your DAOs instead of only some
> generic "getAll()" method. This way, if there are some hundred
> thousands records in your database, Drools will not have to
> instantiate an object for each of them since the DAO/database can
> filter out those objects that are not relevant to the use case.
> If, for example, you write some rule that handles order processing,
> you could write a DAO method "getUnprocessedOrders()" which will
> ignore all orders that are already processed. AFAIK Drools does no
> sharing/caching of objects retrieved via equivalent "from" calls in
> different rules.
> When planning my current project, I quickly found that manually
> retrieving the objects and inserting them into the working memory gave
> me somewhat more flexibility but that of course depends on the use
> case at hand.
> 
> Best regards
> Marcus
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Advantages-and-Disadvantages-of-%22from%22-tp17561274p17562867.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list