Home > Software engineering >  Is there any pattern for having multiple and flexible business rules applies to allow an action to h
Is there any pattern for having multiple and flexible business rules applies to allow an action to h

Time:11-04

I have the following scenario, in my domain, I have an entity on which actors (Users or automated systems) can perform certain action. In order to be allowed to perform this actions, a set of business rules has to be checked depending on the source of the action and other contextual information. If all the business rules are correct the action is perform, otherwise an error should be thrown.

I'm trying to figure it out if there is any pattern that help me develop a system that allows me to have multiple business rules depending on a context. Also, I need that this business rules system to be flexible, I'm working on a rapid-changing domain where the business rules can change from a moment to another.

I know how to create all this from scratch, but, if exists, I prefer using a pattern or something created for this kind of problems.

CodePudding user response:

One possible solution to that problem could be the Specification pattern. You can check it on wikipedia

  • Related