Skip to content

Instantly share code, notes, and snippets.

@justinhj
Last active January 19, 2020 04:15
Show Gist options
  • Select an option

  • Save justinhj/ddf44b78bfc5348e7aca4915273ed4a6 to your computer and use it in GitHub Desktop.

Select an option

Save justinhj/ddf44b78bfc5348e7aca4915273ed4a6 to your computer and use it in GitHub Desktop.
trait PersistentEntity[IDType, T <: PersistentEntity[IDType, T]] {
type Command
type Event
type State
def id: IDType
def state : State
def processCommand(command: Command) : List[Event]
def processEvent(event: Event) : T
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment