Why are case objects serializable and case classes not?
问题 I am playing with this example http://scala.sygneca.com/code/remoteactors to learn how remote actors work in Scala (2.8.0). In particular I slightly modified how the messages send by the actors are defined as it follows: sealed trait Event extends Serializable case object Ping extends Event case object Pong extends Event case object Quit extends Event and everything works as expected. Unfortunately if I define the events as case classes instead of case objects as in: sealed trait Event