I have a SalesOrder class which is inherited by several different types of sales orders. It has a method called ValidateItems(OrderItemList, itemAdditionalValidation), which takes in a list of order items and a delegate for additional validation on an order item. The different sales orders each define their own version of the delegate and then pass it in when they call ValidateItems of the parent SalesOrder class. The delegate takes in an OrderItem object. OrderItem class has a Validate() method. The ValidateItems method goes through the list and calls Validate on each OrderItem and then calls itemAdditionalValidation delegate and passes it in the OrderItem.
So far, when I wanted to validate items, I would always create add all the items to the respective order and then the order would call ValidateItems and take care of all the validation. However, now I want to be able to call OrderItem.Validate directly without creating an order as well, however I don't know how to refactor the delegate. Basically I want the OrderItem to be able to know which delegates to call based on the Order type it's dealing with. Any ideas? Also any tips on how to improve on my current architecture would be greatly appreciated.