Skip to content

Instantly share code, notes, and snippets.

@addybhardwaj
addybhardwaj / DependencyInjectionWithCakePattern.scala
Last active December 15, 2015 17:59
How to beat spring dependency injection in Scala natively. Following Gist illustrates Scala cake pattern for repositories and services design used by tiered architectures in Java world especially. It uses inheritance and generics. Gist also provides how these services can be accessed based on environment i.e. dev/prod/test in Play framework para…
/**
* Following Gist provides
*
* - BaseRepository,
* - Respositories Trait/Implementation,
* - BaseService,
* - Services Traits/Implementations
* - Config to tie services and repositories
* - Registry to add environment specific config like spring profiles (this is for Play framework)
*/