Why people define class, trait, object inside another object in Scala?

Posted by Zwcat on Stack Overflow See other posts from Stack Overflow or by Zwcat
Published on 2011-01-13T14:47:15Z Indexed on 2011/01/13 14:53 UTC
Read the original article Hit count: 133

Filed under:
|

Ok, I'll explain why I ask this question. I begin to read Lift 2.2 source code these days. In Lift, I found that, define inner class and inner trait are very heavily used.

object Menu has 2 inner traits and 4 inner classes. object Loc has 18 inner classes, 5 inner traits, 7 inner objects.

There're tons of codes write like this. I wanna to know why the author write it like this. Is it because it's the author's personal taste or a powerful use of language feature?

© Stack Overflow or respective owner

Related posts about scala

Related posts about lift