In this thread link, concerns the discussion on real example of using the strategy design pattern. The second answer which shows an example of dynamically inserting rules to whether approve/decline the assignment of products to people with the RuleAgent
. This set of rules is invoked using the function IsApproved
.
The example shows what if we wanted to add two more rules, like an intern rule and overtime rule. My question relates to how do we ensure that our polymorphic call to IsApproved
would call ALL the added rules. The question has also been asked in the comment to that answer but no replies.
Could you please comment on how to do this on C++ and/or (if possible) Fortran.