Package org.seedstack.business.domain
Provides classes, interfaces and annotations for building the domain layer.
-
Interface Summary Interface Description AggregateRoot<I> Specialization ofEntitywhen acting as an aggregate root.DomainEvent A domain event is used to represent something that happened in the domain.DomainEventHandler<E extends DomainEvent> Interface for event handlers, which handle events domain events fired by theDomainEventPublisher.DomainEventInterceptor Interface for Interceptors, which handles the execution order of the EventHandlers that are fired.DomainEventPublisher The domain event publisher provides the ability to publishDomainEventinstances to be handled byDomainEventHandlerimplementations.DomainRegistry The domain registry provides programmatic access to domain objects.Entity<I> An entity represent a thread of continuity and identity, going through a lifecycle, though its attributes may change.Factory<P extends Producible> A factory is responsible for creating a whole, internally consistent aggregate when it is too complicated to do it in a constructor.IdentityGenerator<I> A generator of identity for entities.IdentityService IdentityService provides the ability to generate an identity using anIdentityGeneratorand inject it in the specified entity.Producible Marks objects as being able to be produced by a factory.Repository<A extends AggregateRoot<I>,I> A repository is responsible for consistently storing and retrieving a whole aggregate.Repository.Option Marker interface for options that can be used to alter the results of some repository methods.ValueObject A value object measures, quantifies or describes something in the domain. -
Exception Summary Exception Description AggregateExistsException This exception is thrown when the existence of an aggregate is an error condition.AggregateNotFoundException This exception is thrown when the absence of an aggregate is an error condition.IdentityExistsException This exception is thrown when the existence of an identity is an error condition. -
Annotation Types Summary Annotation Type Description Create Marks a method which has the responsibility of creating an entity (i.e.DomainAggregateRoot Marks a type as an aggregate root.DomainEntity Marks a type as an entity.DomainFactory Marks a type as a domain factory.DomainPolicy A policy is used to encapsulate a varying business rule or process in a separate object.DomainRepository This annotation marks repository interfaces.DomainValueObject Marks a type as a value object.Identity This annotation marks the field of an entity as its identity.PriorizedEvent This annotations allows to set aDomainEventInterceptorto interceptDomainEventand alter theDomainEventHandlerproperties (Skip / Add one / Order are examples of what can be achieved with DomainEventHandlerInterceptors)