Solved

DCOM VS COM+/MTS

Posted on 2001-08-06
13
826 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
ID: 6356543
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
ID: 6356699
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
ID: 6356723
GeoffKell:

you are correct.

but couldn't you also create a DCOM instance using DLLHost.exe?
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 5

Expert Comment

by:rkot2000
ID: 6356784
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
ID: 6358599
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
ID: 6359543
>>>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
 

Author Comment

by:Bowthy
ID: 6359602
Thanks rkot2000.

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

Expert Comment

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

Expert Comment

by:rkot2000
ID: 6359685
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
ID: 6359687
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
ID: 6359735
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
ID: 6363381
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
ID: 6363893
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

776 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