Created
September 2, 2016 13:02
-
-
Save trbngr/a503d857639dc15d807508366c5cc7db to your computer and use it in GitHub Desktop.
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
object Protocol extends TopicOneSupport with TopicTwoSupport { | |
/*can't be sealed now*/ trait PMessage | |
} |
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
object Protocol{ | |
sealed trait PMessage | |
case class TopicOne1(id: String) extends PMessage | |
case class TopicOne2(id: String) extends PMessage | |
case class TopicOne3(id: String) extends PMessage | |
// and on and on.... | |
case class TopicTwo(id: String) extends PMessage | |
case class TopicTwo2(id: String) extends PMessage | |
case class TopicTwo3(id: String) extends PMessage | |
// and on and on.... | |
} |
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
trait TopicOneSupport { | |
this: Protocol.type => | |
case class TopicOne1(id: String) extends PMessage | |
case class TopicOne2(id: String) extends PMessage | |
case class TopicOne3(id: String) extends PMessage | |
// and on and on.... | |
} |
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
trait TopicTwoSupport { | |
this: Protocol.type => | |
case class TopicTwo(id: String) extends PMessage | |
case class TopicTwo2(id: String) extends PMessage | |
case class TopicTwo3(id: String) extends PMessage | |
// and on and on.... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment