java-design-patterns icon indicating copy to clipboard operation
java-design-patterns copied to clipboard

Rule engine design pattern

Open mohanaraosv opened this issue 4 years ago • 19 comments

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:

  1. Rule Interface: Defines the contract for all rules, typically including a method to evaluate the rule and another to execute the rule's action.
  2. Concrete Rules: Implementations of the Rule interface, each encapsulating a specific piece of business logic.
  3. Rule Engine: Responsible for managing and executing rules. It evaluates which rules should be applied based on the given context and executes them accordingly.
  4. Context: The data or state that the rules operate on. This is passed to the rule engine and rules during execution.

References:

Acceptance Criteria:

  1. Create a Rule interface with methods to evaluate and execute a rule.
  2. Implement at least three concrete rule classes demonstrating different business logic scenarios.
  3. Develop a RuleEngine class capable of evaluating and executing a set of rules against a provided context.
  4. Include unit tests for the RuleEngine and the concrete rule classes to ensure correctness and robustness.

mohanaraosv avatar Apr 04 '20 21:04 mohanaraosv

I will work on this.

mohanaraosv avatar Apr 08 '20 18:04 mohanaraosv

Great @mohanaraosv

iluwatar avatar Apr 09 '20 19:04 iluwatar

@mohanaraosv are you working on it?

iluwatar avatar Jul 06 '20 16:07 iluwatar

I didn't get a chance to work on this, But I would like to contribute to this let it be on my name.

mohanaraosv avatar Jul 11 '20 14:07 mohanaraosv

Ok @mohanaraosv, let me know if you require assistance

iluwatar avatar Jul 14 '20 12:07 iluwatar

hi @iluwatar Can I pick this up if this is still open? Thanks

arjunduggal avatar Feb 10 '21 00:02 arjunduggal

@mohanaraosv was assigned earlier, but no news yet. Are you still working on it @mohanaraosv or could @arjunduggal take it?

iluwatar avatar Feb 14 '21 09:02 iluwatar

Sorry for the delay!! I have made some progress on this please pick @arjunduggal some other pattern.

mohanaraosv avatar Feb 14 '21 11:02 mohanaraosv

I would love to solve this issue within one month.........

guapi777 avatar Apr 19 '21 07:04 guapi777

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.

ohbus avatar Apr 19 '21 08:04 ohbus

@guapi777 Please pick another issue I have started working on this.

mohanaraosv avatar Apr 22 '21 09:04 mohanaraosv

Expect a PR Timeline: 30-6-2021

mohanaraosv avatar Jun 08 '21 05:06 mohanaraosv

@mohanaraosv are you still working on this?

iluwatar avatar Oct 09 '21 19:10 iluwatar

Sorry for the delay I have updated new timeline expect a PR Timeline: 31-10-2021

mohanaraosv avatar Oct 11 '21 20:10 mohanaraosv

Thanks for the info @mohanaraosv. Looking forward to your PR!

iluwatar avatar Oct 13 '21 16:10 iluwatar

@mohanaraosv are you still working on this?

iluwatar avatar Nov 28 '21 07:11 iluwatar

Hi @iluwatar, We are interested to pick this up. Would you mind assigning this to me? Thanks.

u7076185 avatar Oct 06 '22 07:10 u7076185

Sure thing, assigned to you @u7076185

iluwatar avatar Oct 08 '22 09:10 iluwatar

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.

stale[bot] avatar Nov 28 '22 14:11 stale[bot]