简体   繁体   English

在ASP.net中的物理层之间移动数据的最佳策略

[英]Best strategy for moving data between physical tiers in ASP.net

Building a new ASP.net application, and planning to separate DB, 'service' tier and Web/UI tier into separate physical layers. 构建一个新的ASP.net应用程序,并计划将DB,“服务”层和Web / UI层分隔为单独的物理层。

What is the best/easiest strategy to move serialized objects between the service tier and the UI tier? 在服务层和UI层之间移动序列化对象的最佳/最简单策略是什么?

I was considering serializing POCOs into JSON using simple ASP.net pages to serve the middle tier. 我当时正在考虑使用简单的ASP.net页将POCO序列化为JSON以服务中间层。 Meaning that the UI/Web tier will request data from a (hidden to the outside user) web server that will return a JSON string. 这意味着,UI / Web层将从(向外部用户隐藏)Web服务器请求数据,该服务器将返回JSON字符串。 This kind of JSON 'emitter' seems easily testable. 这种JSON“发射器”似乎很容易测试。 It also seems easily compressible for efficiently moving data over the WAN between tiers. 它似乎也很容易压缩,以便在各层之间通过WAN有效地移动数据。

IIS Asp.net UI webforms
    ^
    ^
-- WAN --
    ^
    ^
IIS Asp.net webforms
 to generate JSON
    ^
SQL Server

I know that some folks use .asmx webservices for this kind of task, but this seems like there is excess overhead with SOAP, and the package is not as human readable (testable) as POCOs serialized as JSON. 我知道有些人将.asmx Web服务用于此类任务,但是SOAP似乎有过多开销,并且该包不像序列化为JSON的POCO那样易于阅读(可测试)。 Others are using more complex technology like WCF which we have never used. 其他人则使用了我们从未使用过的更复杂的技术,例如WCF。

Does anyone have advice for choosing a method for moving data/objects between the data (db) tier and the web (UI) tier over the WAN using .net technologies? 是否有人建议使用.net技术选择通过WAN在数据(db)层和Web(UI)层之间移动数据/对象的方法?

Thanks!!! 谢谢!!!

Sounds like you want a REST API. 听起来像您想要一个REST API。 ASP.NET MVC Controllers will do the trick. ASP.NET MVC控制器可以解决问题。

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

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