|Sent on:||Thursday, February 14, 2013 4:01 PM|
Maybe because of my lack of experience in Scala, I found the Cake Pattern a bit verbose and SubCut a bit intrusive since I need to add SubCut stuff to all my classes. At least, that was my impression when reading the tutorial.
Any views?Hey Sandro,Caveat: I've not written much Scala for about 18 months now so there might be more up to date views than mine.
The approach that I took last time I was using Scala was to use Google Guice, which is a pretty lightweight DI solution not tied into any particular development framework - I suspect you've come across it at some point. The thing to bear in mind is that if you're familiar with a Java library and you feel it does the job it might also be entirely suitable for use when using other languages on the JVM.
That applies to more than just DI, sometimes even when there's a scala-specific library out there it can be easier to use a more mature or better performing Java alternative - I'm not saying that's the case in all or even a majority of situation simply that I wouldn't rule out a Java library even if my code was written in Scala.