diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-02-12 14:19:20 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-02-12 14:19:20 -0600 |
commit | 31037aa59eac67d98aefc2d25f7d30764e319b67 (patch) | |
tree | 4e0497136fca23037c2858f2e205d071ca0851a7 /src/main/scala/cake/services.scala | |
parent | 9074a601970a626a446b5fefed5b30db39092ff6 (diff) | |
download | scala-di-test-31037aa59eac67d98aefc2d25f7d30764e319b67.tar.gz scala-di-test-31037aa59eac67d98aefc2d25f7d30764e319b67.zip |
add a bit more type safety
Diffstat (limited to 'src/main/scala/cake/services.scala')
-rw-r--r-- | src/main/scala/cake/services.scala | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/scala/cake/services.scala b/src/main/scala/cake/services.scala index ed28203..b171165 100644 --- a/src/main/scala/cake/services.scala +++ b/src/main/scala/cake/services.scala @@ -2,15 +2,24 @@ package cake.services trait HasApplication { type ApplicationType - val application: ApplicationType + val application: ApplicationType with IApplication + trait IApplication { + def run (): Unit + } } trait HasDatabase { type DatabaseType - val database: DatabaseType + val database: DatabaseType with IDatabase + trait IDatabase { + def query (search: String): String + } } trait HasLogger { type LoggerType - val logger: LoggerType + val logger: LoggerType with ILogger + trait ILogger { + def log (msg: String): Unit + } } |