I can understand how to use implicit parameters, but I doubt how necessary this is for the scala playback actions ... in the playback documentation:
It is often useful to mark the request parameter as implicit so it can be implicitely used by other APIs that need it
now ... reading this other stackoverflow answer: The implicit keyword before a parameter in an anonymous function in Scala
it seems that using the implicit parameter here is just “syntactic sugar” for
Action { request => Ok("Got request [" + request + "]",request)
my question is:
1) is the scope from the implicit parameter, only the scope of my lambda is not there? ... 2) Am I ignoring something? ...
reading this other answer: When should I create methods with an implicit argument in Scala?
it seems that using the implicit parameter in this case is "excessive", 3) What would the code look like without using the implicit parameter, and which template do I avoid using it?
I am rewriting this code https://stackoverflow.com/a/2129608/ without implicit parameters and definitions, and the code was much more readable and understandable (less implicit: D) ... I know useful cases when implicit parameters are really useful (example : akka api), but I can’t understand how useful the template is and why it should be used ...
thanks!
source share