Class: Synapse::EventSourcing::AggregateFactory Abstract
- Inherits:
-
Object
- Object
- Synapse::EventSourcing::AggregateFactory
- Defined in:
- lib/synapse/event_sourcing/aggregate_factory.rb
Overview
This class is abstract.
Represents a mechanism for creating aggregates to be initialized by an event stream
Direct Known Subclasses
Instance Method Summary collapse
-
#aggregate_type ⇒ Class
abstract
Type of aggregate being created by this factory.
-
#create_aggregate(aggregate_id, first_event) ⇒ AggregateRoot
abstract
Instantiates an aggregate using the given aggregate identifier and first event.
-
#type_identifier ⇒ String
abstract
Type identifier used to store the aggregate in the event store.
Instance Method Details
#aggregate_type ⇒ Class
This method is abstract.
Returns Type of aggregate being created by this factory.
19 20 21 |
# File 'lib/synapse/event_sourcing/aggregate_factory.rb', line 19 def aggregate_type raise NotImplementedError end |
#create_aggregate(aggregate_id, first_event) ⇒ AggregateRoot
This method is abstract.
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.
15 |
# File 'lib/synapse/event_sourcing/aggregate_factory.rb', line 15 def create_aggregate(aggregate_id, first_event); end |
#type_identifier ⇒ String
This method is abstract.
Returns Type identifier used to store the aggregate in the event store.
25 26 27 |
# File 'lib/synapse/event_sourcing/aggregate_factory.rb', line 25 def type_identifier raise NotImplementedError end |