COM +库应用程序的目的是什么? [英] What's the purpose of COM+ library applications?

查看:316
本文介绍了COM +库应用程序的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建COM +应用程序时,向导提供在库和服务器应用程序之间进行选择。

When a COM+ application is created the wizard offers to choose between a library and a server application.

服务器应用程序在单独的进程中激活,用于与64位in-proc COM组件交互64位的消费者。

A server application is activated in a separate process and this can be used to cheaply interop 64-bit consumers with 32-bit in-proc COM components.

在调用者进程中激活的库应用程序的用途是什么?

What's the use of library applications that are activated right in the caller process? Why use them instead of plain old in-proc COM servers?

推荐答案

有几个:


  1. 性能 - 更快,因为您不必通过邮件自动化(编组和解组)

  1. Performance - it is a bit faster as you don't have to go through the message automation (marshalling and unmarshalling)

隔离 - 如果许多不同的应用程序使用库,那么每个应用程序都有自己的副本。这个点在处理MTA(多线程公寓)和STA(单线程公寓模型)之间的区别时最为重要。

Isolation - if many different Applications are using the Library, then each will have it's own copy. This point is most important when dealing with the differences between an MTA (Multi Threaded Apartment) and a STA (Single Threaded Apartment Model)

IN-PROC服务器(这是真正的过程,在呼叫者的进程之外)由所有不同的调用者共享(这是一个伟大的方式有廉价的IPC / RPC)

THE IN-PROC Server (which is really an out of processes, out of the caller's process) is shared by all different callers (this is a great way to have cheap IPC/RPC)

Ok我正在编辑一些更多的定义,更多的引用:

Ok I am editing with a few more definitions, and a bit more references:



  1. 因果关系实际上是一个类似于线程的概念,表示在上下文中使用对象。 (因果关系是一个分布式的COM方法调用链,它跨越任何数量的进程中的任何数量的上下文 - 来自ISBN:0-201-61594-0)

这些概念在大约30页的第2章讨论,来自Tim Ewald的优秀书Transactional COM +ISBN:0-201-61594-0

Those to concepts are discussed in about 30 pages of chapter 2 from Tim Ewald's excellent book "Transactional COM+" ISBN: 0-201-61594-0

所以从第2章的摘要中直接引用:
一个对象可以使用对象上下文和一个给定的因果关系,使用调用上下文与它的上下文进行交互这两个对象提供了与COM +运行时交互的接口服务,这种编码风格,'达到上下文'使COM +开发与经典的COM开发非常不同。

So taking a direct quote from the summary of chapter 2: "An object can interact with its context using object context and with a given causality using call context. These two objects provide interfaces for interacting with COM+ runtime services. This style of coding, 'reaching into context' makes COM+ development very different from classic COM development."

最后,第2章讨论为什么库应用程序?
(这不同于你的问题,为什么不是纯旧的COM?)
他的参数主要表明使用COM对象的相同原因,
1.每个应用程序都有自己的实例。
2.加载到非DLLhost.exe进程。
3.多得少开销。
4.简单部署常用对象。

Finally, Chapter 2 has a discussion "Why Library Applications?", (which is different from your question, Why not just plain old COM?) His arguments mainly indicate the same reasons from using a COM object, 1. Each application has it's own instance. 2. Load into non- DLLhost.exe process. 3. Much Less Overhead. 4. Simple Deploy of common Objects.

所以底线是,如果你不是分布式,而不是自然的事务,可能没有真正的优点是使用COM + over COM。但是如果你编写一个COM +应用程序并将其部署为一个LIBRARY应用程序,它将表现得更像一个COM组件。

So the bottom line is that if you are not Distributed, and Not Transactional In Nature, there may be no real advantage to using COM+ over COM. But if you write a COM+ application and deploy it as a LIBRARY application, it will behave a little bit more like a COM component.

希望有帮助。

这篇关于COM +库应用程序的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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