0

problem context:

  • a list of actions in the system, create this, delete that, edit those etc...
  • a list of roles admin, reader, reporter etc...
  • a list of emails to send, emergency email, alert email, etc...

I have a decision matrix, which describes when a action happens which role should receive which email.

Ideally I want have a XML file or database tables to config this relationship on the fly.

My question is:

Is there any library to borrow?
Any design patterns to follow?

Many thanks

Alexis Dufrenoy
  • 11,784
  • 12
  • 82
  • 124
Junchen Liu
  • 5,435
  • 10
  • 51
  • 62

2 Answers2

0

Although it could be overkill for your use-case, you might wish to look into rules engines. There is a Java API for such engines. The Wikipedia page about this JSR lists a number of implementations. Perhaps one of those provides a rules language that is suitable for your needs. I believe Drools is quite mature (as implementation; not so much in name :/ ) and it supports a wide variety of languages for describing your rules. The Apache License v2 also makes it suitable for many contexts.

G_H
  • 11,739
  • 3
  • 38
  • 82
0

What you are looking for is a rule engine. The main Java frameworks in that domain are Openrules and Drools.

Alexis Dufrenoy
  • 11,784
  • 12
  • 82
  • 124