title: Understand how to use apply and unapply
body: <p>I'm trying to get a better understanding of the correct usage of <code>apply</code> and <code>unapply</code> methods.</p>
  
  <p>Considering an object that we want to serialize and deserialize, is this a correct usage (i.e. the <em>Scala way</em>) of using <code>apply</code>  and <code>unapply</code>?</p>
  
  <pre><code>case class Foo
  object Foo {
      apply(json: JValue): Foo = json.extract[Foo]
      unapply(f: Foo): JValue = //process to json
  }
  </code></pre>