简体   繁体   English

ASP.Net Web应用程序架构

[英]ASP.Net Web Application Architecture

I'm totally rewriting the question.. 我完全重写了这个问题..

I'm new to ASP.Net, and trying to develop a website that is 我是ASP.Net的新手,并试图开发一个网站

- simple, but has many grids
- uesrs will update/delete/insert data on grids/tables through the website

Other facts would be: 其他事实是:

- MS SQL Server 2008
- .Net Framework 4.0
- intranet 
- thin client 
- the website should be secure - no hole for sql injection etc. 
- 10 users
- Database tables are already defined
- no stored procedures are defined yet, but will be soon
- all database related functions will be done through stored procedures.

Can you please suggest which approach would be the best in my situation to communicate with the database securely. 您能否建议在我的情况下哪种方法能够安全地与数据库进行通信。 Entity Framework? 实体框架? LinqToSQL?, WCF? LinqToSQL?,WCF? or ASP.Net Web Service? 还是ASP.Net Web服务?

I was thinking of Entity Framework as suggested below, but here are more questions related to EF: 我正在考虑下面建议的实体框架,但这里有更多与EF相关的问题:

1. Do I need WCF for EF? 
2. if DB tables are already structured, do I need to rebuild DB tables along with EF? 
3. is EF has more secure than ASP.Net Web Service? 
4. Functions are fully done by stored procedures, EF is a good choice? 

Why would you use a webservice? 你为什么要使用网络服务? You can check just communicate with the database through Enterprise Library, LINQ2SQL or Entity Framework 您可以通过Enterprise Library,LINQ2SQL或Entity Framework检查与数据库的通信

也许最简单的方法是使用ASP.NET动态数据

As architecture, I understand MVC, MVC2 or MVC3 frameworks that you can use to build your application. 作为体系结构,我了解可用于构建应用程序的MVC,MVC2或MVC3框架。

As grids you may use MSSQL-side query paging or client side jQuery Datatables paging.. 作为网格,您可以使用MSSQL端查询分页或客户端jQuery Datatables分页。

Entity Framework would be a great choice for this. 实体框架将是一个很好的选择。 You don't need any web services. 您不需要任何Web服务。 EF 4 has a great thing called Code First , but in your case, your tables are done and I wouldn't suggest it. EF 4有一个很棒的东西叫Code First ,但在你的情况下,你的表已经完成,我不会建议。 My recommendation would be for you would be to use N-Tier architecture to design your site. 我的建议是你将使用N-Tier架构来设计你的网站。 Using N-Tier will maintain a separation of your data layer, business rules and your UI. 使用N-Tier将保持数据层,业务规则和UI的分离。 Your data layer should be a separate class project that should only be accessed by your business rule layer. 您的数据层应该是一个单独的类项目,只能由业务规则层访问。 Your UI should never communicate with the data layer and only communicate with your business rule layer. 您的UI永远不应与数据层通信,只能与业务规则层进行通信。 If you want to go even further, program your site to an interface using something like IoC and Ninject . 如果您想更进一步,请使用IoCNinject之类的程序将您的站点编程到界面。 This will ensure a true separation of data and UI. 这将确保数据和UI的真正分离。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM