Rules Engine - pros and cons

前端 未结 12 1225
北荒
北荒 2020-12-02 04:25

I\'m auditing a project that uses what is called a Rules Engine. In short, it\'s a way to externalize business logic from application code.

This concept is entirely

12条回答
  •  星月不相逢
    2020-12-02 05:03

    The biggest complexity from my experience in Rule Engines is that:

    1. from OOP POV it's a real pain to refactor and test rules written in a declarative language while you are refactoring code that affects them.
    2. Often we should always think about the execution order of rules which turns into a mess when there are lots of them.
    3. Some minor changes may trigger incorrect behaviour of rules leading to production bugs. In practice it's not always possible to cover all cases with tests up front.
    4. Rules mutating objects used in other ones also increase complexity causing developers to break them into stages.

提交回复
热议问题