Composite Design Pattern in Scala
++ returns a new collection, you need ++= here
Your attempt looks fine to me. Maybe you should additionally implement the Traversable trait or so, and delegate the calls to elements in order to make things a little bit more convenient.


[Edit]

class CompositeObservation(obss: Observation*) 
     extends Observation with Traversable[Observation] {

  val elements = new MutableList[Observation]()

  elements ++= obss

  def hasElement(o: Observation): Boolean = elements.contains(o);

  def foreach[U](f: (Observation) =&gt; U): Unit = elements.foreach(f)
}