具有最佳实践的示例 N 层 ASP.NET MVC3 应用程序(使用 EF 4.1)
我正在寻找一个演示最佳实践的示例 ASP.NET MVC3 N 层应用程序(首先使用域驱动设计和实体框架 4.1 代码)。我发现了以下内容。您推荐其中哪一个(或此列表中没有的其他任何一个)?
I am looking for a sample ASP.NET MVC3 N-Tier application that demonstrates best practices (uses Domain Driven Design and Entity Framework 4.1 Code first). I found the following. which one do you recommend out of these (or any other one not in this list)?
http://prodinner.codeplex.com/
http://www.dofactory.com/Framework/Framework.aspx (not free)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
不久前我也处于同样的境地。
您链接的东西没问题,但它们本身肯定还不够。
我发现这个主题缺乏免费资源,因为它很大并且需要良好的组织和广度。另一方面,如果你愿意付出一点钱,也有很好的资源。
这些是我使用的资源:
PluralSight - 培训视频。 (每月 30 美元,非常值得,不是附属机构,而是订阅者)
以下是有关该主题的精彩课程:
面向对象设计原理 - Steve Smith 着,他是一位伟大的讲师。
设计模式库 - 超过 10 小时的设计视频模式。无法将它们与 DotFactory 进行比较,但它们做得非常好。
控制反转 - 顾名思义,深入的重要话题。
还有很多关于 TDD、MVC、EF 等的内容。都是有价值的主题。
Kindle 上的书籍(我读的书不多,但 Kindle 确实重燃了我对书面知识的热情)
专业企业 .NET
Microsoft® .NET:构建企业应用程序
应用领域驱动设计和模式:以 C# 和 .NET 为例
I was in the same position not long ago.
The things you linked are OK, but certainly not enough on their own.
I find this topic lacking in the free resources, as it is quite big and needs good organization and breadth. On the other hand, there are good resources if you are willing to pay a little.
These are the resources I used:
PluralSight - training videos. ($30 per month, quite worth it, not affiliated, but a subsciber)
Here are the courses that are great on the topic:
Principles of Object Oriented Design - by Steve Smith, he is a great lector.
Design Patterns Library - over 10 hours of videos on design patterns. Can't compare them to DotFactory, but they are very well done.
Inversion of Control - what the name says, important topic in depth.
There are also lots of stuff on TDD, MVC, EF etc. All worthy topics.
Books on Kindle (I haven't been reading lots of books, but Kindle really revived my passion for written knowledge)
Professional Enterprise .NET
Microsoft® .NET: Architecting Applications for the Enterprise
Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
您见过以下项目吗?他们还拥有源代码,可以拥有完整的文档。
http://microsoftnlayerapp.codeplex.com/
http:// /www.nopcommerce.com
Have you seen the following projects? They also have the source code that they can have complete documentation.
http://microsoftnlayerapp.codeplex.com/
http://www.nopcommerce.com
最佳实践总是主观的。您的应用程序可能需要
DI
和Interceptors
,但示例应用程序相对较小,将任何东西放入其中都是荒谬的。不过,我建议您访问 MVC Music Store。它有很好的实现和非常好的示例。http://mvcmusicstore.codeplex.com/
Best practices are always subjective. Your application may require
DI
and as well asInterceptors
but sample apps are relatively small and putting anything into there turns out to be ridiculous. Still, I would suggest you to go through MVC Music Store. It has pretty good implementation and a very good sample.http://mvcmusicstore.codeplex.com/
虽然这篇文章很旧,但我也遇到了同样的问题,为一个好的 ntier 应用程序找到一个好的和现代的模式。经过几个小时的观察,我发现了 Jeffrey Palermo 的洋葱建筑。这是一篇必读的文章。这里:jeffreypalermo.com/blog/the-onion-architecture-part-1/
通过使用本文和其他一些研究,我制作了一个使用 Entity Framework 6.0 和 Ninject 依赖注入 3.2.0 的架构模板(示例)
NTierCSharpExample
我这个模板:中心层是域层。然后是服务层,它是表示层和数据层之间的桥梁。
为简单起见,我使用控制台应用程序进行演示,但您可以简单地将其删除并插入新的 asp.net mvc 5 应用程序或您想要的任何其他演示应用程序。
Although this post is old, But I have had same problem to find a good and modern pattern for a good ntier application. After I goggling for some hour, I Found Onion Architecture By Jeffrey Palermo. It is a must read article. here: jeffreypalermo.com/blog/the-onion-architecture-part-1/
By using this article and using some other researches I Made a template (Example) of this architecture that uses Entity Framework 6.0 and Ninject Dependency Injection 3.2.0
NTierCSharpExample
I this template: Center Layer Is Domain Layer. Then Service Layer that is a bridge between presentation and Data Layer.
For simplicity I used console app for presentation but you can simply remove it out and plug in a new asp.net mvc 5 application or any other presentation app you want.
有趣的是,这种问题至少最近每周都会出现几次。
根据我的经验和反馈,我只能说,关于不同项目的分层,请在此处检查问题和我的答案:
MVC3 和实体框架
RKP 这并不能完全回答您的问题,而是关于架构分层以及一些关于原因的想法(请参阅我的答案下的评论)。
Funny this kind of question comes up couple of times per week at least recently.
What I can say, only about the layering of the different projects, accordingly to my experience and feedback I've got, is to check question and my answer here:
MVC3 and Entity Framework
RKP this is not answering all and completely to your question, is about layering the architecture and some ideas on why only (see comments under my answer).
我基于 EF 4.1 和 MVC3 制作了一个很好的模式:
MVC3 和 EF 架构
祝你好运
I make a good pattern based on EF 4.1 and MVC3:
MVC3 and EF architecture
good luck