Play! framework uses a of statics

后端 未结 14 1941
太阳男子
太阳男子 2020-12-07 15:29

Waaah, the Play! framework has so many static methods. Where I go to school, we were told never ever to use any statics, yet Play! uses it like there\'s no tomorrow

14条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 15:53

    From a very brief look, I'd say it kind of makes sense: web requests are stateless, so there is no object to receive the request (=the method). Thus, mapping an URI such as "/articles/archive?date=08/01/08&page=2" to a static method called archive() on, I guess, your application class makes sense.

提交回复
热议问题