Last active
July 13, 2018 04:59
-
-
Save huntc/65dafc5b737d4cc1fe0492d52379c2e3 to your computer and use it in GitHub Desktop.
OO inheritance for data modelling - describes types of events that share a common identifier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed abstract class Event(val id: Int) | |
final case class CountersUpdated(override val id: Int, | |
counter: Option[Int]) | |
extends Event(id) | |
final case class DeviceIdUpdated(override val id: Int, deviceId: Int) extends Event(id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment