I have been reading about doing Dependency Injection in scala via the cake pattern. I think I understand it but I must have missed something because I still can\'t see the
Think about what happens if TwitterService
uses TwitterLocalCache
. It would be a lot easier if TwitterService
self-typed to TwitterLocalCache
because TwitterService
has no access to the val localCache
you've declared. The Cake pattern (and self-typing) allows for us to inject in a much more universal and flexible manner (among other things, of course).