Note: The difference between using tuple and mapping is that when you are using tuple the construction and deconstruction functions don’t need to be specified (we know how to construct and deconstruct a tuple, right?).

The mapping method just let you define your custom functions. When you want to construct and deconstruct a case class, you can just use its default apply and unapply functions, as they do exactly that!

Of course often the Form signature doesn’t match the case class exactly. Let’s use the example a form that contains an additional checkbox field, used to accept terms of service. We don’t need to add this data to our User value. It’s just a dummy field that is used for form validation but which doesn’t carry any useful information once validated.

As we can define our own construction and deconstruction functions, it is easy to handle it: