Skip to content

Instantly share code, notes, and snippets.

@justinhj
Last active January 19, 2020 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinhj/ddf44b78bfc5348e7aca4915273ed4a6 to your computer and use it in GitHub Desktop.
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