Solved

Just explain me what is  COM, DCOM, WebServices (easy)

Posted on 2004-03-26
4
767 Views
Last Modified: 2013-11-25
Can someone explain me what is COM, DCOM, WebServices?
My most used languages are Delphi, ASP and PHP.
It would be nice if there is some examples for it. (cases of use and maybe code)

Tnks a lot.
Rafael Cardoso
0
Comment
Question by:rafamvc
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:JohnBPrice
Comment Utility
COM is Microsofts Common Object Model.  Basically, it's a standard way to implement components on one machine running Windows such that they are language independant, e.g. you can use a COM object from Delphi, ASP, or PHP.  It is a set of a handful of functions every COM object MUST implement (e.g. "tell me what your properties are"), and calling standards, e.g. string format.

'simplified ASP Example
  dim x
  set x = server.createobject("ADODB.RecordSet")
  x.open "Select * from MyTable"

DCOM is Distributed COM, enabling you to create and use COM objects on a different computer than where your code is running.  DCOM is good in that it hides almost every aspect of distributing your object, e.g. you can get and set properties and call methods the same way as if the COM object is local.  DCOM is bad in than it is horribly slow compared to other RPC mechanisms and only works within a Microsoft Network, not over the Internet.  Some tools support DCOM directly, e.g. in VB you can do

set x = createobject("ADODB.RecordSet", "MachineName")

In other lanaguages, you have to register the object in windows (using dcomcnfg) as a remote object, and then then it looks like a local COM object (except for being horribly slow).

SOAP, Simple Object Access Protocol, by the way, was Microsoft's (an IBM's I believe) attempt to solve the problem of accessing objects over the Internet.  Essentially it wrapped COM objects and exposed a HTML/XML interface that would work over the Internet.

WebServices, like SOAP, enables you to expose "services" over the Internet through a standardized XML interface.  Unlike SOAP, WebServices are not intended solely for objects, but rather any "service".  Because it is just an XML interface, you can use it from any language (or COM components) that allow you to do standard Internet operations.  Unlike DCOM, you have more control of what actions require an interaction over the network.  Like DCOM, it is horribly slow compared to RPC, but at least the slow operations are more exposed so you know why it is slow.  Most tools have good support for COM or DCOM, as they have been around for a while.  You can create a COM object in Visual Studio 6.0 in seconds flat.  If you want to do WebWervices, you either have to use the latest tools (e.g. Visual Studio .Net, don't know about Delphi or PHP), or do a lot of the underlying plubing yourself (parsing XML and whatnot)

As usual there are always exceptions to the above.  e.g. I think you can do COM under Linux with the right third party libraries.
0
 

Author Comment

by:rafamvc
Comment Utility
"set x = server.createobject("ADODB.RecordSet")"

ADODB.RecordSet is a COM Object, Correct? Or i´m using COM to create a instance of a ADODB.RecordSet Object?
If i´m using COM to create Object, how i program and object like that, and where i register/say to my app that this object exists.

"WebServices, like SOAP, enables you to expose "services" over the Internet through a standardized XML interface.  Unlike SOAP, WebServices are not intended solely for objects, but rather any "service".  Because it is just an XML interface, you can use it from any language (or COM components) that allow you to do standard Internet operations.  Unlike DCOM, you have more control of what actions require an interaction over the network.  Like DCOM, it is horribly slow compared to RPC, but at least the slow operations are more exposed so you know why it is slow.  Most tools have good support for COM or DCOM, as they have been around for a while.  You can create a COM object in Visual Studio 6.0 in seconds flat.  If you want to do WebWervices, you either have to use the latest tools (e.g. Visual Studio .Net, don't know about Delphi or PHP), or do a lot of the underlying plubing yourself (parsing XML and whatnot)"

I spend my day reading MSDN about WebServices, and i notice that all the say are about sending a XML file and receiving a XML file, that is my need (i will talk about what i need). But MSDN doesnt say nothing about who receive (infact where i program to process my XML received) or who will create the XML to send. I compreend that i can do it with a lot of languages, but i need to register it somewhere, like a dll? or a simple ASP.NET can handle it?



More Points. To make it worth. ;)

[]´s
Rafael Cardoso
0
 
LVL 16

Accepted Solution

by:
JohnBPrice earned 100 total points
Comment Utility
Yes, ADODB.RecordSet is a COM object, and yes, you are using the COM runtime (e.g. the CreateObject command) to create an instance of a the COM object.

In ASP, you do not have to say to your app that the object exists (it will error out at runtime if it doesn't exist), you do, however, have to tell Windows that your COM object exists by registering it.  The CreateObject command looks for registered Windows COM objects by name.  In most languages you do not have to tell the app that the object exists (and you can't in ASP), but you can usually tell your IDE that you are using a particular set of COM objects so it's smartsense can do it's thing.  Most COM objects and languages which create COM objects will automatically register your COM objects with Windows, or you can manually register by running "regsvr32 MyLibrary.ocx".  You can have multiple COM objects in one .ocx or .exe or .dll (often COM objects in an .exe are self registering when you run the .exe)

While you can use COM objects in ASP or PHP, you can not develop new COM objects in ASP or PHP.  I'm sure you can in Delphi, but I don't use Delphi.

Under the covers, WebServices are nothing more than accepted XML standards for posting a XML file that contains a request, and a web application which replies with an XML that comprises the reply.  e.g. you can do it in PHP,  ASP or ASP.Net.  There is no analogue to COM registration in WebServices (last I heard).  WebServices do allow for a special request format for you to identify what your service does and what parameters it takes, and there are some places where you can post your service so that others can find it.  This is UDDI, Universal Description, Discovery, and Integration, and these are entirely optional as I understand it.  However, some IDE's, like Visual Studio.Net, have wizards that will use UDDI to generate some code for you, which can save a lot of typing, and it is probably good form for you to support UDDI if you are building an "official" WebService.  There are lots of examples of web services that are not "official" WebServices, however.  For example you can post a query to MapQuest and get a response, even though it doesn't conform to UDDI.


0
 

Author Comment

by:rafamvc
Comment Utility
tnks a lot ;)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 6 48
count7 challenge 12 66
countHi2 challenge 7 43
Change to event 1 72
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

772 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

9 Experts available now in Live!

Get 1:1 Help Now