我想遵循以下模式中的DDD。DDD - 業務決策是基於數據庫邏輯
Controller-----DataContract----> Domain Layer (DDD)
Controller-----Domain Object---> Repository---Entity--->EntityFramework
正如您上面的圖中看到,領域層是獨立做出商業決策,但對我來說,大部分的商業決策採取的飛行。例如,
if(Account Number Associated?)
Load CustomerDetails //A database call is needed
....
.....
if(Has customer another loan)
.....
.....
Load other loan details //A database call is needed
.....
.....
if(Was that repaid?)
....
....
Load collateral details //A database call is needed
.....
.....
Calculate collateral details and return.
else
Load other data //A database call is needed
else
Load other data //A database call is needed
else
Load other data //A database call is needed
正如您看到上述示例,應用程序正在通過進行數據庫調用進行大量業務決策。由於域層應該不取決於存儲庫層,我不知道如何繼續。
我可以使用應用服務的數據庫調用,但隨後領域層不會有任何的邏輯在裏面。所有的邏輯將進入應用服務。
請幫我這個。
-Pandian
嗨@VoiceOfUnreason,感謝您的幫助。前兩種方法在我的情況下是不可能的。您能否指點我一些github/code這種「域名服務」的例子?另外,當你說「應用程序提供了實現」意味着「**應用程序服務**提供了實現」對吧? – Pandiarajan