Posts

Dynamic Rules

  Dynamic Rules   Imagine you live in a world where item costs, item prices, sales tax rules, business rules, approval rules, validation rules, rules which govern how we extend credit to our customers, and reorder strategies change over time.     Example scenario: It is mid February and we are a retail store with physical store front and website/internet presence. Assume f or an order to be valid, it the sum must be under $1000 starting in  February , then start of March, it changed to requiring $2000. Then start of April, orders cannot be placed by any customer that owe us money over 90 days.      Think about having a specific validator class for each entity that requires it: public sealed class OrderValidator { private readonly IOrderRuleRepository _ruleRepository ; public OrderValidator ( IOrderRuleRepository ruleRepository ) { _ruleRepository = ruleRepository ; } public ValidationResult...