Class StatefulAggregateInstanceFactory.ObjenesisAggregateInstanceFactory
java.lang.Object
dk.cloudcreate.essentials.components.eventsourced.aggregates.stateful.StatefulAggregateInstanceFactory.ObjenesisAggregateInstanceFactory
- All Implemented Interfaces:
StatefulAggregateInstanceFactory
- Enclosing interface:
- StatefulAggregateInstanceFactory
public static class StatefulAggregateInstanceFactory.ObjenesisAggregateInstanceFactory
extends Object
implements StatefulAggregateInstanceFactory
StatefulAggregateInstanceFactory that uses Objenesis to create a new instance of the AggregatePlease note: Objenesis doesn't initialize fields nor call any constructors, so you
Aggregate design needs to take
this into consideration.All concrete aggregates that extends
AggregateRoot have been prepared to be initialized by Objenesis-
Nested Class Summary
Nested classes/interfaces inherited from interface dk.cloudcreate.essentials.components.eventsourced.aggregates.stateful.StatefulAggregateInstanceFactory
StatefulAggregateInstanceFactory.ObjenesisAggregateInstanceFactory, StatefulAggregateInstanceFactory.ReflectionBasedAggregateInstanceFactory -
Field Summary
Fields inherited from interface dk.cloudcreate.essentials.components.eventsourced.aggregates.stateful.StatefulAggregateInstanceFactory
DEFAULT_REFLECTION_BASED_CONSTRUCTOR_AGGREGATE_ROOT_FACTORY, OBJENESIS_AGGREGATE_ROOT_FACTORY -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ObjenesisAggregateInstanceFactory
public ObjenesisAggregateInstanceFactory()
-
-
Method Details
-
create
Description copied from interface:StatefulAggregateInstanceFactoryCreate an instance of theAggregate- Specified by:
createin interfaceStatefulAggregateInstanceFactory- Type Parameters:
ID- the type of aggregate idAGGREGATE- theAggregateimplementation type- Parameters:
id- the id valueaggregateType- theAggregateimplementation type- Returns:
- new aggregate instance
-