java-design-patterns
java-design-patterns copied to clipboard
Rule engine design pattern
Description: The Rules design pattern is a behavioral design pattern that enables the encapsulation of business rules into isolated, reusable units. This pattern allows for the dynamic application of business logic at runtime and promotes the separation of concerns, making the system more modular and easier to maintain.
Main Elements of the Pattern:
- Rule Interface: Defines the contract for all rules, typically including a method to evaluate the rule and another to execute the rule's action.
- Concrete Rules: Implementations of the Rule interface, each encapsulating a specific piece of business logic.
- Rule Engine: Responsible for managing and executing rules. It evaluates which rules should be applied based on the given context and executes them accordingly.
- Context: The data or state that the rules operate on. This is passed to the rule engine and rules during execution.
References:
Acceptance Criteria:
- Create a Rule interface with methods to evaluate and execute a rule.
- Implement at least three concrete rule classes demonstrating different business logic scenarios.
- Develop a RuleEngine class capable of evaluating and executing a set of rules against a provided context.
- Include unit tests for the RuleEngine and the concrete rule classes to ensure correctness and robustness.
I will work on this.
Great @mohanaraosv
@mohanaraosv are you working on it?
I didn't get a chance to work on this, But I would like to contribute to this let it be on my name.
Ok @mohanaraosv, let me know if you require assistance
hi @iluwatar Can I pick this up if this is still open? Thanks
@mohanaraosv was assigned earlier, but no news yet. Are you still working on it @mohanaraosv or could @arjunduggal take it?
Sorry for the delay!! I have made some progress on this please pick @arjunduggal some other pattern.
I would love to solve this issue within one month.........
Thanks for your interest @guapi777
But @mohanaraosv already seems to be engaged with it. Please contact him if you would like to continue where he left.
Thanks.
@guapi777 Please pick another issue I have started working on this.
Expect a PR Timeline: 30-6-2021
@mohanaraosv are you still working on this?
Sorry for the delay I have updated new timeline expect a PR Timeline: 31-10-2021
Thanks for the info @mohanaraosv. Looking forward to your PR!
@mohanaraosv are you still working on this?
Hi @iluwatar, We are interested to pick this up. Would you mind assigning this to me? Thanks.
Sure thing, assigned to you @u7076185
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.