6

与大多数 Java 应用程序服务器使用的模型相比,我想更好地理解 .NET 应用程序服务器模型的原因。

在我看到的大多数 ASP.NET Web 应用程序的情况下,业务逻辑都托管在 Web 服务器的 asp.net 主机进程中。另一种常见的方法是拥有一个物理或逻辑不同的层来托管您的业务对象,然后作为 Web 服务公开或通过 WCF 等机制进行访问。当需要更高的规模时,通常但似乎并不总是使用后一种方法。在 COM 对象时代,我看到 Microsoft Transaction Server (MTS) 和后来的 COM+ 托管用于托管包含业务逻辑的 COM 对象,MTS(理论上)管理对象生命周期、事务、并发 yada yada。这种模式在很大程度上似乎已经在 ASP.NET 领域消失了。

在 Java 世界中,您可能将 Apache 与 Tomcat 作为 servlet 容器,并将您的业务对象托管在 Tomcat 中。在这种情况下,Tomcat 提供了与 MTS 在 .NET 世界中提供的功能类似的功能。

几个问题:

  1. 为什么 Microsoft 与 Java 的应用程序服务器方法存在根本差异?这一定是创建这些框架时的架构/设计选择。
  2. 每种方法的优缺点是什么?
  3. 为什么微软从 MTS 托管模型(类似于 Tomcast servlet 托管模型)转移到更常见的当前方法,即将业务对象作为 Web 服务器的 ASP.NET 进程的一部分?
  4. 如果您想在今天的 ASP.NET 应用程序中实现 MTS 类型方法或 Tomcat 类型方法,我假设一种常见模式是在某些 IIS 进程中托管业务对象(可能在某些不同的物理或逻辑层上)并通过 WCF 访问(或标准 asmx Web 服务,等等)。这是一个正确的假设吗?
4

1 回答 1

2

To my way of thinking, the primary difference is in the "open" approach vs. the "integrated stack" approach. Microsoft likes to provide everything as an integrated stack that all shares a common flavor and approach. Java is more friendly to the "bring your own x" model, where you may want to plug in your favorite application server, transaction manager, etc. Both technology stacks allow in-process invocation as well as remote invocation with varying levels of transaction support.

Really, WCF is not a new technology stack, but a reorganization and rebranding of existing elements of the .NET stack. Specifically, WCF took on the functions of .NET Remoting, Web Services, and distributed transactions.

You reference "the more common current approach which is just to have business objects as part of the web server's ASP.NET process." That is only common for non-distributed apps. It is a simple model that works well when all of your objects will reside on the same server. This follows Microsoft's "Scale Out" deployment model. Rather than segregating object tiers across servers, put everything but the database together on the web servers and then incrementally add identical, redundant servers to scale out the web-server layer.

Microsoft has been pushing hard lately on Service Oriented Architecture, which relies more heavily on WCF and remote invocation. This is seen as a key to the cloud strategy that would have people moving parts or all of their applications to flexible resources in the cloud (which MS would like to host with Azure and the like).

于 2010-08-11T18:24:12.007 回答