3

我正在创建一个数据库中包含 70 多个表的应用程序,它将在下一阶段增加。

我使用 Asp.net MVC:模型、实体框架、视图模型、存储库、视图、控制器、操作过滤器、参考、多语言……

这些部件在我的解决方案中的最佳位置是什么?

我已经看到了拆分解决方案的不同方法。例如:

  - Solution
        - Core.UI
            - Domain
            - UI
               - Models
            - Persistence
        - Core.Test
        - UI
            - Content
            - Controller
            - Views
            - Scripts

或者另一个说把它分成

  - Solution
        - Model
        - Entities
        - Web
        - References

或者

...

您对 DDD(领域驱动设计)有何看法?以及如何实施?你推荐它吗?


  • 我希望我的项目具有最大的灵活性最佳选择,因为当项目很大时,更改其结构将更加困难。
  • 我想以各种形式交换信息(Web 和 html、客户端应用程序、移动设备、xml....)
  • 我想单独更改和构建我的项目的基本部分 (现在和将来)

如果您可以帮助我提供详细信息或示例。

非常感谢...

4

2 回答 2

3

The key thing here is that you want to avoid coupling so that you can stay productive throughout the development of the app. In order to do that, you want to do a Service-Oriented Architecture.

Instead of n-tier apps which break down the problem into horizontal slices (layers) , Service-Oriented Architecture instead takes vertical slices of the application (services).

Start with this video by Udi Dahan if you want to learn the basic ideas of Service-Oriented Architecture. Hint: you're starting off on the wrong foot if you've already designed the database.

The two dudes whose stuff you want read here are Udi Dahan and Greg Young. I would also recommend the DDD Google Group to ask more detailed questions. DDD questions don't always fit StackOverflow as well as other computing questions because they're so nuanced and usually require a lot of back and forth to get to the bottom of the issue.

于 2012-08-02T13:28:58.773 回答
1

直接回答这个问题并不容易。这取决于您的业务需求、应用程序的规模等。

Microsoft Spain 提供了一个参考实现。尽管它有一些缺点,但它仍然是一个很好的起点。如果您有足够的时间,只需决定需要哪些概念/模式,哪些不需要。

http://microsoftnlayerapp.codeplex.com/

于 2012-08-02T12:55:30.850 回答