应用架构mvc4 EF5 [英] application architecture mvc4 ef5

查看:141
本文介绍了应用架构mvc4 EF5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划一个项目开发使用MVC4,EF5和Web API的应用程序。请任何人都建议我们如何在不同的层设计的项目。网络使用MV​​C4层和数据层使用EF5 / Repository模式和Web API进行访问的JQuery

I am planning for one project to develop an application using MVC4, EF5 and Web Api. Please anyone suggest how we to design project in different layer. Web using MVC4 and Data Layer using EF5/Repository pattern and Web Api for JQuery access.

推荐答案

我会建议使用如下图所示的图层。

I would recommend using the layers shown in the following diagram.

我添加的工作设计模式的部门横跨多个存储库处理事务。而且我也用处理所有的业务逻辑应用程序或领域层。当您使用域层,然后你的Web API只是成为处理对象到远程客户端的传输和系列化薄薄的一层,如您的Web客户端(即Web浏览器)。 Web客户机使用JQery AJAX和Web API进行通信。该MVC控制器是用来渲染视图(您的HTML,CSS和JavaScript)。 MVC的在这个架构模型部分是应用程序/域层。请注意,这个架构也适用将与单页的应用程序(水疗)

I added the Unit of Work Design Pattern which handles transactions across multiple Repositories. And I also use an application or domain layer that handles all of the business logic. When you use an domain layer then your Web API just becomes a thin layer that handles the transport and serialization of objects to remote clients such as your web client (i.e. web browser). The web client uses JQery ajax to communicate with the Web API. The MVC Controller is used to render Views (Your HTML, CSS and JavaScript). The Model part of the MVC in this architecture is your Application/Domain Layer. Note that this architecture also works will with Single Page Applications (SPAs).

这篇关于应用架构mvc4 EF5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆