What's diffrence between Assembly and COM Object.

  • Thread starter Thread starter Larry
  • Start date Start date
L

Larry

Hi my friends,

In dotnet framework, intruduced conception of assembly, which can be shared
by other program. Assembly can also exist as DLL file or EXE file. And It
can be updated smoothly and avoid version problem. It seems assembly can
realize same functions as COM objects. So in the future, do we still use
ALT or VB to create and use COM objects ? or we just useassembley ?

I ask this question, because I'm learning ATL. If in the future we only use
assemly instead of COM objects, I don't want to waste my time to learn it.

I really appreicate your help.

Laurence
 
An assembly file (which is slightly different in meaning from an assembly in
general) is basically a binary PE executable in a special format. In that
respect, old EXE and DLLs were also both binary PE executables. The
difference is in the format of the files and the fact that assembly files
contain IL for the main program instead of platform-dependant op codes.

The main difference between COM and .NET (in terms of their reusable
component aspect) is that COM was a middle-man that worked on top of your
code, to allow code written in different languages to interoperate.
..NET on the other hand, depends on CLI and CIL, so that different languages
compile to similar code, and that code produced in one language is
indistinguishable from code produced in another language. They have common
types, object footprints, and op codes. Because of this, programs written in
one language can natively use components written in another language, and
they don't even really know that the component was written in another
language. This eliminates the complex translations and marshalling that COM
managed in between both sets of code. In this respect, interoperation of
code and component in .NET is more natural and faster.
However, COM is far from dead, and ATL is the ideal library for writing COM
components. You can write COM components in .NET (assemblies can be used
by/with COM with certain limitations), but this requires even more of the
complex translation and marshalling I was talking about earlier - definitely
NOT as efficient as ATL.

-Rob
 
Back
Top