java - Scala and @Inject annotation -


i know best way deal dependency injection in scala using tools built language, working on project must integrate scala , java code.

then, using google guice, implements specification jsr-330. fortunatly, found no problem during integration of guice , scala. using constructor injection, because have deal immutability.

my question is, why in scala have use notation @inject() in front of constructor parameter? why () paranthesis? follows example:

class myclass @inject() (val another: anotherclass) {   // body of class } 

otherwise, how tell if (val another: anotherclass) constructor parameter list or arguments @inject?


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -