title: Composition in Scala, based on objects (singletons)
body: <p>I want to make a composition with two objects. I can do it with objects nesting:</p>
  
  <pre><code>object Composition {
    object SomePartOfComposition {
      // some body
    }
  }
  </code></pre>
  
  <p>But the body of SomePartOfComposition is such long, that I want it in a separate file. How can I do that?</p>
  
  <p>// edit</p>
  
  <p>I know, that I can use trait. But I want strict one to one relation - it is a singleton.</p>