Created
July 24, 2012 12:47
-
-
Save nisshiee/3169761 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
case class Person(name: String, age: Int) |
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
case class Person(id: Int, name: String, age: Int) |
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
case class Person(id: Option[Int], name: String, age: Int) |
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 trait Person { | |
val name: String | |
val age: Int | |
} | |
case class IdentifiedPerson(id: Int, name: String, age: Int) extends Person | |
case class UnIdentifiedPerson(name: String, age: Int) extends Person |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment