示例n层ASP。NET MVC3应用程序的最佳实践(使用EF 4.1)

时间:2021-08-11 04:11:57

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)?

我正在找一个样本ASP。NET MVC3 n层应用程序,演示最佳实践(使用域驱动设计和实体框架4.1代码优先)。我发现以下。你推荐其中的哪一个(或者其他不在这个列表中的)?

http://efmvc.codeplex.com/

http://efmvc.codeplex.com/

http://prodinner.codeplex.com/

http://prodinner.codeplex.com/

http://www.dofactory.com/Framework/Framework.aspx (not free)

http://www.dofactory.com/Framework/Framework.aspx(不*)

6 个解决方案

#1


9  

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)

PluralSight——培训视频。(每月30美元,很值得,不是附属的,而是附属的)

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.

设计模式库——超过10小时的设计模式视频。不能和DotFactory相比,但是它们做得很好。

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.

在TDD、MVC、EF等方面也有很多值得关注的话题。

Books on Kindle (I haven't been reading lots of books, but Kindle really revived my passion for written knowledge)

Kindle上的书(我没有读过很多书,但Kindle真的让我重新燃起了对书面知识的热情)

Professional Enterprise .NET

专业企业。net

Microsoft® .NET: Architecting Applications for the Enterprise

Microsoft®. net:为企业架构的应用程序

Applying Domain-Driven Design and Patterns: With Examples in C# and .NET

应用领域驱动的设计和模式:使用c#和。net中的示例

#2


2  

Have you seen the following projects? They also have the source code that they can have complete documentation.

你看过下面的项目吗?他们也有源代码,他们可以有完整的文档。

http://microsoftnlayerapp.codeplex.com/

http://microsoftnlayerapp.codeplex.com/

http://www.nopcommerce.com

http://www.nopcommerce.com

#3


1  

Best practices are always subjective. Your application may require DI and as well as Interceptors 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.

最佳实践总是主观的。您的应用程序可能需要DI和拦截器,但示例应用程序相对较小,而在其中放置任何东西都是荒谬的。不过,我还是建议你去MVC音乐商店。它有很好的实现和一个很好的示例。

http://mvcmusicstore.codeplex.com/

http://mvcmusicstore.codeplex.com/

#4


1  

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/

虽然这篇文章很旧,但是我在为一个好的ntier应用程序找到一个好的现代模式时遇到了同样的问题。在我咯咯地笑了几个小时之后,我发现了杰弗里·巴勒莫的《洋葱建筑》。这是必读的文章。: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

通过使用本文和其他一些研究,我制作了这个架构的模板(示例),使用了Entity Framework 6.0和Ninject Dependency Injection 3.2.0

NTierCSharpExample

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.

我这个模板:中心层是域层。服务层是表示层和数据层之间的桥梁。为了简单起见,我使用控制台应用程序进行演示,但您可以简单地将其删除,并插入一个新的asp.net mvc 5应用程序或任何其他您想要的演示应用程序。

#5


0  

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

MVC3和实体框架

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).

RKP这并不是完全回答你的问题,而是关于架构的分层和一些关于为什么只有的想法(参见我的回答下面的评论)。

#6


0  

I make a good pattern based on EF 4.1 and MVC3:

我根据EF 4.1和MVC3做了一个好的图案:

MVC3 and EF architecture

MVC3和EF架构

good luck

祝你好运

#1


9  

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)

PluralSight——培训视频。(每月30美元,很值得,不是附属的,而是附属的)

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.

设计模式库——超过10小时的设计模式视频。不能和DotFactory相比,但是它们做得很好。

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.

在TDD、MVC、EF等方面也有很多值得关注的话题。

Books on Kindle (I haven't been reading lots of books, but Kindle really revived my passion for written knowledge)

Kindle上的书(我没有读过很多书,但Kindle真的让我重新燃起了对书面知识的热情)

Professional Enterprise .NET

专业企业。net

Microsoft® .NET: Architecting Applications for the Enterprise

Microsoft®. net:为企业架构的应用程序

Applying Domain-Driven Design and Patterns: With Examples in C# and .NET

应用领域驱动的设计和模式:使用c#和。net中的示例

#2


2  

Have you seen the following projects? They also have the source code that they can have complete documentation.

你看过下面的项目吗?他们也有源代码,他们可以有完整的文档。

http://microsoftnlayerapp.codeplex.com/

http://microsoftnlayerapp.codeplex.com/

http://www.nopcommerce.com

http://www.nopcommerce.com

#3


1  

Best practices are always subjective. Your application may require DI and as well as Interceptors 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.

最佳实践总是主观的。您的应用程序可能需要DI和拦截器,但示例应用程序相对较小,而在其中放置任何东西都是荒谬的。不过,我还是建议你去MVC音乐商店。它有很好的实现和一个很好的示例。

http://mvcmusicstore.codeplex.com/

http://mvcmusicstore.codeplex.com/

#4


1  

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/

虽然这篇文章很旧,但是我在为一个好的ntier应用程序找到一个好的现代模式时遇到了同样的问题。在我咯咯地笑了几个小时之后,我发现了杰弗里·巴勒莫的《洋葱建筑》。这是必读的文章。: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

通过使用本文和其他一些研究,我制作了这个架构的模板(示例),使用了Entity Framework 6.0和Ninject Dependency Injection 3.2.0

NTierCSharpExample

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.

我这个模板:中心层是域层。服务层是表示层和数据层之间的桥梁。为了简单起见,我使用控制台应用程序进行演示,但您可以简单地将其删除,并插入一个新的asp.net mvc 5应用程序或任何其他您想要的演示应用程序。

#5


0  

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

MVC3和实体框架

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).

RKP这并不是完全回答你的问题,而是关于架构的分层和一些关于为什么只有的想法(参见我的回答下面的评论)。

#6


0  

I make a good pattern based on EF 4.1 and MVC3:

我根据EF 4.1和MVC3做了一个好的图案:

MVC3 and EF architecture

MVC3和EF架构

good luck

祝你好运