【发布时间】:2015-09-28 01:49:50
【问题描述】:
我研究Onion Architecture 已经有一段时间了,我分析了几个示例VS 的解决方案,仍然无法理解Onion Architecture 中Core 和Domain 之间的区别。
- 在this 解决方案核心(项目)位于域(解决方案文件夹)内。
- Here 没有核心,只有域
- 在 Jeffrey Palermo 的 CodeCampServer 示例应用程序中,Core 中有 Domain。所以,基本上看起来
Core是由Domain和Services组成的。 - 在this xDriven项目中
Core分为Core.Application和Core.Domain
我完全糊涂了。你能解释一下,在这种架构中Core 和Domain 之间的实际区别是什么?
例如,我有这门课。简单的棋盘游戏,例如井字游戏。它绝对是无处不在的语言,所以我应该在域内的Entities 文件夹中创建它吗?以及 Core 中的域本身?
public class Game
{
public GameState State { get; set; }
public Board Board { get; set; }
public IEnumerable<Player> Players { get; set; }
public bool Move(int playerId, int field)
{
//Check if Player's move will finish game. If yes, return true
return false;
}
}
【问题讨论】:
标签: c# .net domain-driven-design onion-architecture