How to shoot yourself in the foot with Scala traits and Spring
Suppose you have some class MyService configured as Spring bean:
@Component
class MyService extends MyBaseService {
def myOperation() {
...
}
}
Which is referenced somewhere in the project:
...
@Autowired
private var myService: MyService = _
...
So far this code works, and now you'd like to mix in some trait into your service to add common functionality:
@Component
class MyService extends MyBaseService with MyTrait {