I am trying to play 2.4.2 for Scala, and I do not understand whether controllers should be defined as classes or singlets. Status of documents:
A controller is nothing more than a singleton object that generates Action Values.
However, the sample code shows:
class Application extends Controller { ... }
To complicate matters even further, intellij gives me a warning if I define a class:

However, I get a compilation error (but without warning) if I use singleton:
package controllers import play.api._ import play.api.mvc._ object Application extends Controller { ... }
Error: (6, -1) Play 2 Compiler: / Users / Toby / IdeaProjects / playscala / conf / routes: 6: type Application is not a member of package controllers
Which approach is right?
Toby hobson
source share