.NET Remoting、Web 服务、Windows Communication Foundation (WCF)

发布于 2024-07-12 08:27:50 字数 539 浏览 1 评论 0原文

有人愿意帮助我了解 .NET 远程处理、Web 服务和 WCF 的优缺点吗? 我在 .NET 远程处理和 Web 服务方面进行了一些工作,并且正在构建一个新的 ASP.NET 3.5 Web 应用程序,我将在其中使用 SQL 2008 DB。 我主要想知道是否值得真正研究此应用程序的 WCF。

在这个特定实例中,以下是一些相关点:

  • 大多数持久性数据将是错误和使用情况跟踪。
  • 即使我使用 .NET Remoting,流量也无法保证物理远程服务器的安全,但我梦想有一天会如此!
  • 目前,我预计不需要从其他网络应用程序获取这些数据。

但是,我仍然想知道:

  • 何时/为什么要在 Web 应用程序中使用 .NET Remoting?
  • 您何时/为何要在 Web 应用程序中使用 Web 服务?
  • 您何时/为何在 Web 应用程序中使用 WCF?
  • 我应该考虑 LINQ to SQL 等技术吗?
  • 还有其他更好的选择吗?

Anyone willing to help me out with pros/cons on .NET Remoting, Web Services, and WCF? I have worked a bit with .NET Remoting and Web Services and I am architecting a new ASP.NET 3.5 web app where I will be using a SQL 2008 DB. Primarily I am wondering if it would be worthwhile to really look into WCF for this app.

In this particular instance, here are some relevant points:

  • Most persistent data will be error and usage tracking.
  • Even if I go with .NET Remoting, traffic will not warrant a physical remoting server, but I'd like to dream that it one day will!
  • At this time, I do not foresee needing to grab this data from other web apps.

However, I'd still like to know:

  • When/why would you use .NET Remoting in a web app?
  • When/why would you use Web Services in a web app?
  • When/why would you use WCF in a web app?
  • Should I consider a technology such as LINQ to SQL?
  • Are there other better options are out there?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

渡你暖光 2024-07-19 08:27:50

实际上,我将我们的软件从传统的 .NET Remoting 切换到了 WCF。 远程处理中发生的通信膨胀是惊人的(只需查看wireshark 跟踪即可)。 在转向 WCF 之前,我考虑过只使用传统的 .NET Web 服务,但是我们为远程调用实现的接口需要进行大量修改(我们使用了一些 out 和 ref 参数,如果我不这样做,Asp.Net Web 服务就无法做到这一点)错误)。

真的,我想不出使用 Asp.Net Web 服务的理由,但我不是一个 Asp.Net 人。 对我来说,它比 WCF 没有任何优势。 使用 Web 服务可能更容易,但 WCF 提供的灵活性正是我所需要的。 特别是在消息格式方面。

我喜欢我的 WCF 服务,因为通过一项服务,我可以提供 JSON 或 SOAP/XML,并且支持所有协议(ipc、tcp 和 http)。

WCF 的缺点是,如果您希望在基于 Web 的场景中使用它,它的严格绑定要求您为 HTTP 和 HTTPS 定义端点。 与传统的 Web 服务不同,传统的 Web 服务无论安全与否都“正常工作”。

I actually switched our software from traditional .NET Remoting to WCF. The bloat in communication that occurred from Remoting was amazing (just look at a wireshark trace). Before moving to WCF i thought about using just a traditional .NET webservice, but the interfaces we implimented for our remoting calls would require to much modification (We had used some out and ref parameters which an Asp.Net webservice cant do if I am not mistaken).

Really, I cant think of a reason to go with an Asp.Net webservice, but Im not an Asp.Net guy. To me, it offers no advantages over WCF. It may be easier to go with a webservice, but the flexibility WCF offered was what I needed. Especially in the area of message formatting.

I like my WCF service because with one service I can either serve up JSON or SOAP/XML and all the protocols are supported (ipc, tcp, and http).

The bummer with WCF is that its strict bindings require you to define an endpoint for both HTTP and HTTPS if you wish to use it in a web based scenario. Unlike a traditional Webservice which "just works" regardless if its secure or not.

我不会写诗 2024-07-19 08:27:50

好问题! 像您一样,我以前没有看过 WCF,并且想知道它是否会使 Web 服务或多或少过时?

关于您关于 Linq2SQL 的观点 - 考虑到这是一个出色的新应用程序,并且您可能会在好几年内维护代码库 - 就个人而言(并且冒着被否决的风险 - 但请记住,这是一个有效的观点视图!)我倾向于查看实体框架。

我知道它的缺点,对我来说最大的缺点是它与 DAL 耦合太紧密 - 因此它不能轻松地进行单元测试(相信我,这对我来说是一个大问题,尽管我确实有一种直觉实现此目的的解决方法)。

然而,我个人的观点是微软不会让这项技术半途而废,而且我必须考虑到它将取代 L2S 的传言。 另一方面,L2S 是一种更加成熟的技术,也是一种更安全的选择。

也许我很天真,但我相信 Dan Simmons,他说他们正在致力于将 EF(最终)作为一个完全持久无知的架构提供 - http://blogs.msdn.com/dsimmons/pages/ef-faq-entity-classes.aspx#_Does_Entity_Framework

Good question! Like yourself I've not looked at WCF before and wonder whether it render web services more or less obsolete?

On your point about Linq2SQL - given that this is a spanky new app and you're probably going to be maintaining the codebase for a good few years - personally (and at the risk of being downvoted for this - but remember it's a valid point of view!) I'd be inclined to look at the Entity Framework.

I am aware of it's faults, the biggest for me being that it is too tightly coupled to the DAL - therefore it cannot be unit tested easily (believe me, this is a BIG problem for me, although I do have a gut feeling there is a work-around to achieve this).

However, my personal opinion is that MS are just not going to let this technology fall by the wayside, and I'd have to take into consideration the rumours it will REPLACE L2S. The flipside of that is that L2S is a much more mature tech and a safer bet.

Maybe I'm being naive, but I believe Dan Simmons when he says they are working on delivering the EF (eventually) as a completely persistent-ignorant architecture - http://blogs.msdn.com/dsimmons/pages/ef-faq-entity-classes.aspx#_Does_Entity_Framework

秉烛思 2024-07-19 08:27:50

我更愿意研究 EF,然后再研究 L2SQL。

只能连接到 MSSQL 的想法是我从未采用 L2SQL 的原因,从那时起很明显 MS 有一天会放弃它。

I would rather look into EF then L2SQL too.

The idea of being only able to connect to MSSQL was the reason i never adopted L2SQL, from that point it was clear that MS would give up on it someday.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文