Normalize Common Rules

As you develop your rule set, you may notice rules which are similar across different parts of your rule set functionality.

You should endeavor to identify common rules and centralize them.

Broadly you have two options available when centralizing common rules:

Sometimes it can be tricky to identify which mechanism to use when centralizing common rules. In general you should use inheritance carefully, only when the sub-rule class represents a business concept which genuinely "is an" instance of the business concept represented by the super-class. In particular, CER does not support multiple inheritance.

An example of inheritance is where a person has resources, and each resource might be a building or a vehicle. The Building and Vehicle rule classes each extend an abstract Resource rule class. See the listing in Rule Classes.

You should use containment when the business concept represented by a rule class "has an" instance of the business concept represented by the rule class being contained.

An example of containment is where a person has many different age range tests applied. The Person rule class creates many instance of AgeRangeTest.

If you find you have similar rule classes across different rule sets, you should consider using CER's facilities (since Cúram V6) for allowing one rule set to reference artefacts in other. Place the common rule classes in one or more common rule sets, and place rule classes which are not common in other rule sets.