class Synapse::EventSourcing::AggregateFactory
Represents a mechanism for creating aggregates to be initialized by an event stream @abstract
Public Instance Methods
aggregate_type()
click to toggle source
@abstract @return [Class] Type of aggregate being created by this factory
# File lib/synapse/event_sourcing/aggregate_factory.rb, line 19 def aggregate_type raise NotImplementedError end
create_aggregate(aggregate_id, first_event)
click to toggle source
Instantiates an aggregate using the given aggregate identifier and first event
The first event is either the event used to create the aggregate or the most recent snapshot event for the aggregate.
@abstract @param [Object] aggregate_id @param [DomainEventMessage] first_event @return [AggregateRoot]
# File lib/synapse/event_sourcing/aggregate_factory.rb, line 15 def create_aggregate(aggregate_id, first_event); end
type_identifier()
click to toggle source
@abstract @return [String] Type identifier used to store the aggregate in the event store
# File lib/synapse/event_sourcing/aggregate_factory.rb, line 25 def type_identifier raise NotImplementedError end