How to adapt the Specification pattern to evaluate a combination of objects?
问题 I know that the Specification pattern describes how to use a hierarchy of classes implementing ISpecification<T> to evaluate if a candidate object of type T matches a certain specification (= satisfies a business rule). My problem : the business rule I want to implement needs to evaluate several objects (for example, a Customer and a Contract). My double question : Are there typical adaptations of the Specification patterns to achieve this ? I can only think of removing the implementation of