Solved

DCOM VS COM+/MTS

Posted on 2001-08-06
13
812 Views
Last Modified: 2013-11-25
Hello,

Can anyone tell me why I should be using DCOM rather than MTS/COM+ or vice-versa.

I've only used MTS and COM+ , and have been taking it for granted that DCOM isn't a contender.  I've struggled to find an argument for or against DCOM vs MTS/COM+ anywhere and noone I ask seems to  know for sure.

Thanks for your time, it's much appreciated.

 
0
Comment
Question by:Bowthy
  • 4
  • 4
  • 4
  • +1
13 Comments
 
LVL 5

Expert Comment

by:dredge
Comment Utility
first of all, you're groupings are incorrect.

COM+ is a combination of COM, DCOM, and MTS.

and secondly, there is no comparison to do, or argument for or against "DCOM vs. COM+/MTS".

DCOM stands for Distributed Component Object Model. this means that you can install your COM .DLL file on ServerA, and use that specific from Workstation1, or any other computer on your network.

MTS is Microsoft Transaction Server - this is a transactional based service provider. what this means, is that you can put your .DLL files (or whatever file) into MTS and have true Transactional capabilities - meaning that you set up groups of functions in a transaction. If any of these functions fails, then the entire group of functions is cancelled, and the transaction is rolled back.


COM+ is the combination of COM, DCOM, and MTS into one simple package, instead of 2 (technically 3) seperate packages. COM+ is built into the operating system of Win2k (and XP)
0
 
LVL 5

Expert Comment

by:GeoffKell
Comment Utility
dredge - DCOM implies out of process server and therefore must be an ActiveX EXE not a DLL

Regards
GK
0
 
LVL 5

Expert Comment

by:dredge
Comment Utility
GeoffKell:

you are correct.

but couldn't you also create a DCOM instance using DLLHost.exe?
0
 
LVL 5

Expert Comment

by:rkot2000
Comment Utility
DLLHost.exe - is dcom utility to run a dll on remote server, because you need to have a process to host dll.
this is the worst scenario to run a remote component

dcom/mst/com+
full story on http://www.microsoft.com/com/wpaper/compsvcs.asp
http://www.microsoft.com/msj/0198/mtscom/mtscomtop.htm

for small projects you can use activex exe, for big ones actvexdll + mts / com +
0
 

Author Comment

by:Bowthy
Comment Utility
Thanks for the info, guys, you're helping me bring it together.

So, you're saying I'm missing the point.

Is it correct to say:

1. MTS and COM+ provide an environment that enables DCOM.

2. "Out of process" ActiveX EXEs don't need MTS/COM+ to be DCOM-enabled (as they have their own process).  

3. ActiveX DLLs do need MTS/COM+ or similar to be DCOM-enabled, as they are "in-process" (and so it follows need a process to be in).

4. DLLHost.exe should be avoided as it's a bit shoddy.

Having made the points above, we can say:

(Now, stay with me here, I'm going even further back to basics.)  You can't call a DLL on one machine from an exe client on another machine without the DLL having a process in which to run.  Processes cannot be transfered across machines.

So, the client could call an ActiveX EXE on the server which could in turn call the DLL.  The DLL would run in the same process as the ActiveX EXE.

But, Microsoft have kindly built a very sophisticated ActiveX EXE called MTS so why not use that?


0
 
LVL 5

Expert Comment

by:rkot2000
Comment Utility
>>>MTS and COM+ provide an environment that enables DCOM.
It is not exactly correct
History :
DDE ? OLE Automation ? COM ? DCOM ? MTS ? COM +
DCOM ? was before MTS, and as you  stated MTS simplified DCOM development.


COM + - With the release of Windows 2000, all the best ideas of COM, DCOM and MTS have been integrated into a new run time named COM+. Unlike MTS, this new run-time layer isn?t optional. COM+ is part of the default installation of Windows 2000. But the good news is that the COM-versus-MTS dilemma doesn?t exist on Windows 2000. Moreover, writing components for COM+ is easier than for MTS because many of the annoying idiosyncrasies associated with MTS have gone away.

>>>But, Microsoft have kindly built a very sophisticated ActiveX EXE called MTS so why not use that?

It true, but MTS is additional overhead plus you need to install it on your server. (COM + is included with 2000).
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Bowthy
Comment Utility
Thanks rkot2000.

So before MTS, DCOM was limited to ActiveX EXEs?
0
 
LVL 5

Expert Comment

by:dredge
Comment Utility
no, you could use dllhost.exe to run DCOM .DLL files, before MTS.
0
 
LVL 5

Expert Comment

by:rkot2000
Comment Utility
dredge is correct. microsoft named this : surrogate process

again back to msdn :

Running in-process components remotely: Surrogate
In order to run in-process components remotely, a surrogate process on the remote machine is required. In addition to enabling remote execution, surrogate processes offer the following benefits:

Faults in the in-process server are isolated to the surrogate process.


One surrogate process can service multiple clients simultaneously.


Clients can protect themselves from untrusted server code, while accessing the services the server provides.


Running an in-process server in a surrogate gives the DLL the surrogate's security.
Windows NT 4.0 Service Pack 2.0 and DCOM for Windows 95 introduced a default surrogate process, as well as a protocol for writing custom surrogates. The default implementation of the surrogate process is a mixed-threading, model-style, pseudo-COM server. When multiple DLL servers are loaded into a single surrogate process, this process ensures that each DLL server is instantiated using the threading model specified in the registry for that server. If a DLL server supports both threading models, then COM will choose multithreading. This surrogate process is written so that COM handles both the unloading of DLL servers and the termination of the surrogate process.

0
 

Author Comment

by:Bowthy
Comment Utility
Oh , ok, but dllhost doesn't give you any of the sophistication of MTS, which I guess is why rkot2000 said about using dllhost "this is the worst scenario to run a remote component".





0
 
LVL 5

Accepted Solution

by:
rkot2000 earned 100 total points
Comment Utility
plus you can have better threads managment and ...

I think the best solution for dcom is :
acvitex exe or (activex dll under mts or com +)

again from msdn :
if you are building distributed objects for arbitrary clients, you are probably better off implementing outofproc servers, or perhaps hosting your inproc server in MTS.
0
 

Author Comment

by:Bowthy
Comment Utility
I wish I could give you all some points, but
rkot2000 gave the fullest answer (in my opinion).

Thank you all very much.
0
 
LVL 5

Expert Comment

by:dredge
Comment Utility
just so you know,

it's common for a person to create a new question specifically directed towards a user (usually something like "Points for UserName") so that more than one person can get points for one question.

when you do this, you have to reference the question that the person helped you on, otherwise the EE staff consider it gaming and may kick both of the accounts off the site.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now