DDDの思想をもとに(?)、真面目に「アプリケーション層からインフラ層を触ることを不可能にする」という制約を実現しようとしたら、sbtのモジュール構成こうなるのでは?という話。実際やるとコストかかりそうなので、ここまでやるべきなのかどうか?は、別問題だけれども。
Last active
August 29, 2015 14:03
-
-
Save xuwei-k/c84be12291d4fa07cf37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val infra = project | |
lazy val domainInterface = project // interfaceのみを定義。infraに依存しないのがポイント | |
lazy val domainImpl = project.dependsOn(infra, domainInterface) // domainの実装定義 | |
lazy val app = project.dependsOn(domainInterface) // アプリケーション層は、原理的にinfraに触れないようにする | |
lazy val program = project.dependsOn(app, domainImpl) // 全部を合成。ここは合成するためのコードのみを置く場所であり、ここに処理はできるだけ書かない |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment