In a CRM pipeline, all business rules are encapsulated in the same process, executing all business rules whareas we do not need to do this way.
The CRM Plugin pipeline should implement a strategy by separting the executing of the business rules from their execution rule. So, a rule validation would clarify when the business rule has to be executed.
Regarding the problem, implementing design patterns regarding the CRM pipeline would be helpful.
Using Rule Pattern, Factory Pattern, Singleton Pattern, Dependency Injection help to separate the execution rules in CRM pipeline related to an entity from the rules of validation related to the same entity as well.
Moreover, all rules of validation could be aggregated regarding one process related to one entity, trigerring the business rule if needed.
Some challenges of implementing this separation include :
-- Lifecycle of the objects : avoid stackoverflow, memory handling,...
-- Complexity : initialization of plugins will increase if we increase the number of entities,...
-- Performance : do not increase the initial performance of the plugins, not made for bulk operations,...
Use this pattern to:
-- isolate the execution (process) from the execution rules or validation rules
-- to tag the execution rules with the messagename (i.e. Creation,...), with the pipeline stage (i.e PreOperation,...)
This pattern may not be suitable:
-- for small projects, for lesser degree of complexity