This is called a "self-tuning annotation" and requires that any use of trait DatabaseSessionSupport in the instance class must be accompanied by a ("mixed with") type consistent with ScalatraBase . I did not consider this specific code, but most likely it uses the so-called "cake pattern".
You can find many methods of this concept both in stack overflow, and in various blogs and in the classic work of Odersky et. et al., entitled " Scalable Component Abstractions ."
source share