Link to home
Start Free TrialLog in
Avatar of rafamvc
rafamvc

asked on

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

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
Avatar of JohnBPrice
JohnBPrice

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.
Avatar of rafamvc

ASKER

"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
ASKER CERTIFIED SOLUTION
Avatar of JohnBPrice
JohnBPrice

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rafamvc

ASKER

tnks a lot ;)