Question
ValueLabs
SA
Last activity: 19 Jun 2017 0:27 EDT
Backward Chaining VS Forward Chaining
1)Which approach is better ,Backward Chaining or Forward Chaining? justify.
2)How can the developers ,at design time, choose from either of these? Consider example of A=B+C.
***Moderator Edit: Vidyaranjan | Updated Categories***
-
Likes (5)
Hani Yaaqby Chandra madhu Nalli pogu Viplav Khandaria Filippo Alciator S MANOJ KUMAR REDDY -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
StaidLogic
IN
Hi Salman,
I am not suggesting to exclude declare expressions. Declare expressions are better and to be used based on application requirements.
In the above details I am just suggesting to choose forward / backward chaining cleverly so that it takes less processing time.
In case of above expression: A=B+C
if B and C are changing frequently better to choose backward chaining. So that expression triggers only when A is used.
or
if A is used many places for display and calculations better to choose forward chaining. So that when input changes target is calculated and ready for usage.
**Need to choose between the 2 cleverly based on input / target property utilization**.
Hope it is clear.
Thanks,
Ananda Bhat
Pegasystems Inc.
IN
Hello Salman,
Forward chaining is executed when the value of any of the source properties change.
Backward Chaining mode executes when the target property is referenced. Backward chaining is supported only for declare expressions.
Based on your requirement, we need to choose the Forward or backward chaining. For your example i.e. A=B+C, we need to use forward chaining. when property B and C value changes we need to calculate A value.
Regards,
Praveen
-
P Rahul Chandra madhu Nalli pogu Mukesh Awachar S MANOJ KUMAR REDDY
Pegasystems Inc.
IN
Below link will help in great details in evaluating pros and cons for both approaches along with detailed explaination.
-
Ahmed Hazzaf Jyothirmai Potnuru Nikhil Kommalapati YALAMATI Rohini Akhila Yarradla and 10 More
ValueLabs
SA
You didn't provide the link.
-
Jyothirmai Potnuru SACHIDANANDA CHOUDHURY S MANOJ KUMAR REDDY
Pegasystems Inc.
IN
StaidLogic
IN
Hi Salman,
The expression A=B+C can be configured to use forward chaining or backward chaining.
It has to be decided depending on how frequently these values change and used.
If values of B and C changes frequently and in future steps you are using A in few places, then better to use backward chaining(ie calculate value of A when ever it is used).
If input values are not changing frequently and target property is used frequently in the application then you can go for forward chaining(ie calculate A when ever input changes).
Hope it helps.
Thanks,
Ananda Bhat
-
Jeeva Thambi Pavlin Paunov Merve Mallı Dasika Srinivas Maciej Czapiewski and 4 More
ValueLabs
SA
Hi Ananda Bhat.
Thanks for your reply. But, I have a question here.
Above, you said,
"If values of B and C changes frequently and in future steps you are using A in few places, then better to use backward chaining(ie calculate value of A when ever it is used)." And
"If input values are not changing frequently and target property is used frequently in the application then you can go for forward chaining(ie calculate A when ever input changes)."
So, by these two statements, you are suggesting to execute Declare Expression rule as less as possible to improve performance, right? Is my understanding correct?
If yes, then a question. What chaining to go for when if input values are changing frequently and target property is used frequently in the application?
-
S MANOJ KUMAR REDDY Amardeep Kumar Srivastava
Accepted Solution
StaidLogic
IN
Hi Salman,
I am not suggesting to exclude declare expressions. Declare expressions are better and to be used based on application requirements.
In the above details I am just suggesting to choose forward / backward chaining cleverly so that it takes less processing time.
In case of above expression: A=B+C
if B and C are changing frequently better to choose backward chaining. So that expression triggers only when A is used.
or
if A is used many places for display and calculations better to choose forward chaining. So that when input changes target is calculated and ready for usage.
**Need to choose between the 2 cleverly based on input / target property utilization**.
Hope it is clear.
Thanks,
Ananda Bhat
-
vijay sekar jothimani sai mounika gunnam KOWSALYA Kowsalya Murilo Nunes Viplav Khandaria and 3 More