Package dk.cloudcreate.essentials.components.eventsourced.aggregates.stateful
package dk.cloudcreate.essentials.components.eventsourced.aggregates.stateful
-
ClassDescriptionStatefulAggregate<ID,
EVENT_TYPE, AGGREGATE_TYPE extends StatefulAggregate<ID, EVENT_TYPE, AGGREGATE_TYPE>> AggregatespecificInMemoryProjector
Note: An in memory projection is never associated with aUnitOfWorkand any changes to the aggregate won't automatically be persisted.Factory that helps theStatefulAggregateRepository/StatefulAggregateInMemoryProjectorto create an instance of a givenAggregate.StatefulAggregateInstanceFactorythat usesObjenesisto create a new instance of theAggregate
Please note: Objenesis doesn't initialize fields nor call any constructors, so youAggregatedesign needs to take this into consideration.
All concrete aggregates that extendsAggregateRoothave been prepared to be initialized byObjenesisStatefulAggregateInstanceFactorythat calls the default no-arguments constructor on the concreteAggregatetype to create a new instance of theAggregateStatefulAggregateRepository<ID,EVENT_TYPE, AGGREGATE_IMPL_TYPE extends StatefulAggregate<ID, EVENT_TYPE, AGGREGATE_IMPL_TYPE>> OpinionatedAggregateRepository that's built to persist and load a specificStatefulAggregatetype in combination withEventStore,UnitOfWorkFactoryand aStatefulAggregateInstanceFactory.
You can use theStatefulAggregateRepository.from(ConfigurableEventStore, AggregateEventStreamConfiguration, StatefulAggregateInstanceFactory, Class)to create a newStatefulAggregateRepositoryinstance that supports the most common repository method.
Alternatively you can extend from theStatefulAggregateRepository.DefaultStatefulAggregateRepositoryand add your own special methodsStatefulAggregateRepository.DefaultStatefulAggregateRepository<ID,EVENT_TYPE, AGGREGATE_IMPL_TYPE extends StatefulAggregate<ID, EVENT_TYPE, AGGREGATE_IMPL_TYPE>> DefaultStatefulAggregateRepositoryimplementation.