title: What is the best way to define custom methods on a DataFrame?
body: <p>I need to define custom methods on DataFrame. What is the better way to do it? The solution should be scalable, as I intend to define a  significant number of custom methods.</p>
  
  <p>My current approach is to create a class (say <code>MyClass</code>) with <code>DataFrame</code> as parameter, define my custom method (say <code>customMethod</code>) in that and define an implicit method which converts <code>DataFrame</code> to <code>MyClass</code>.</p>
  
  <pre><code>implicit def dataFrametoMyClass(df: DataFrame): MyClass = new MyClass(df)
  </code></pre>
  
  <p>Thus I can call:</p>
  
  <pre><code>dataFrame.customMethod()
  </code></pre>
  
  <p>Is this the correct way to do it? Open for suggestions.</p>