Class: Synapse::EventSourcing::ConflictResolver Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse/event_sourcing/conflict_resolver.rb

Overview

This class is abstract.

Represents a mechanism that is capable of detecting conflicts between applied changes to the aggregate and unseen changes made to the aggregate.

Direct Known Subclasses

AcceptAllConflictResolver

Instance Method Summary collapse

Instance Method Details

#resolve_conflicts(applied_changes, committed_changes) ⇒ undefined

This method is abstract.

Checks the list of changes applied to the aggregate and compares it to the list of events already applied to the aggregate. If a conflict is detected, this should throw an exception. Otherwise, the changes will be applied.

Parameters:

  • applied_changes (Array)

    List of changes applied to the aggregate

  • committed_changes (Array)

    List of events that were unexpected by the command handler

Returns:

  • (undefined)

Raises:

  • (ConflictingModificationException)

    If any conflicts were detected



17
18
19
# File 'lib/synapse/event_sourcing/conflict_resolver.rb', line 17

def resolve_conflicts(applied_changes, committed_changes)
  raise NotImplementedError
end