interface SpecificationComposite

SpecificationComposite is a subtype of EntityComposite that is used to ensure the contractual rules of the EntityComposite during an EntitySession.

Description

The SpecificationComposite is consulted by the EntitySession during the completion of the EntitySession, and the SpecificationComposite must return a list of rule validations, or null if there are no violations.

This maps directly into the Specification concept in the Domain-Driven Design book.

The mechanics for this is,
On EntitySession.complete(), the EntitySession will call the Entity.verifySpecification() on all EntityComposites that has been involved in the session. Each EntityComposite can declare its own Specification strategy, through Concerns and potentially MixinTypes, and standard ones will be available in the libraries. The Concern that handles the verifySpecification() will call the SpecificationComposite.verify() passing the EntityComposite instance as argument. That method returns a List of violations or null if no problems found.

Declaration

package org.qi4j

import

public interface
{

}

Example

Description of Example goes here...
  if( ... )
Powered by SiteVisionexternal link.