Architecture Question
Posted
by
katie77
on Programmers
See other posts from Programmers
or by katie77
Published on 2011-11-24T23:56:20Z
Indexed on
2011/11/25
2:17 UTC
Read the original article
Hit count: 209
I am writing a rules/eligibility Module. I have 2 sets of data, one is the customer data and the other is the customer products data. Customer data to Customer products data is one to many.
Now I have to go through a set of Eligibility rules for each of this Customer product data. For each customer products data, I can say the customer is eligible for that product or decline the eligibility and should move on to the next product record.
So in all the rules, I need to have access to customer and customer product data(the particular record that the rules are being executed against). Since all the rules can either approve a product or decline a product, I created an interface with those 2 methods and is implementing the this interface for all the rules. I am passing the Customer data and one product data for all the rules (because rules should be executed on each row of customer product data). An Ideal situation would be having the customer and customer product data available for the rule instead of passing them to each rule.
What is the best way of doing this in-terms of architecture?
© Programmers or respective owner