jsuereth/sbt-in-action-examples

CH5 <-> CH2, CH3, CH4: Inconsistent Kitten Case Class

Closed this issue · 2 comments

case class Kitten(id: Long, attributes: Set[String])

<->

case class Kitten(id: String, attributes: Seq[String])

=Dusan

The reasoning for changing Seq to Set is given in the book:

"This means that we've probably got our data model wrong. This shouldn't be a List[String], but instead a Set[String]. So, we have to fix our model, changing the List into a Set." (5.3)

The inconsistency in the type of id (Long v.s. String) still remains though.

The book has been fixed. Thanks!