Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is .NET replacement for COM?

I want to know purpose of .NET and COM ,

  • Is .NET has the same purpose as that of COM ? Because main purpose of COM is to allow language interoperability so as that of .NET ?
  • If so Why many companies still using COM for their development projects ?
  • Is it worth learning COM when we can use .NET ?
like image 527
Xinus Avatar asked Aug 14 '10 13:08

Xinus


People also ask

Is .net or .com better?

Generally speaking, .com domains are the best choice for most companies and individuals looking to establish a web presence, simply due to the fact that they are far more common than the alternatives. A . net domain, in particular, is ranked lower by Google than a .com.

Is .com or .net better for SEO?

Com and Net SEO FAQ Realistically, .com is better for SEO than . net. This isn't because Google or other search engines prefer websites with the .com extension on a technical basis. It is because internet users naturally remember .com websites easier than domains with other extensions, such as .

Is .net or .com safer?

In general, the . net extension is trusted and perceived as authoritative by consumers. It's also been around enough that people can easily remember it.


2 Answers

  1. One of the reasons for COM was that if you developed a C++ library in Borland C++ builder you couldn't use it in VB6. But you couldn't use it in VC6 either (COM is way older than these products btw). So COM is a C like protocol for interopability between applications and libraries. .NET allows for interopability between managed applications. If you want to interop with C++ use C++/CLI. But what do you do if you have a legacy COBOL application that wish to use a .NET component? Exposing that component as COM would be one way to approach it. Exposing a C like API is another way.

  2. Not suprisingly since COM has been around since the late 80s (I think) alot of business value has been built on COM tech. It makes no business sense and is way too costly and risky to rewrite working applications to .NET just for the fun of it. So companies that have to maintain legacy applications naturally have lot of COM based tools and apps.

  3. It all depends on your business case. Can you get away with .NET platform only I guess you don't need to know COM (although COM is used by .NET platform and sometimes errors leak through). If you are using COM libraries exposed by the operating system or other libraries it makes sense knowing some basic COM rules.

PS. I like COM. I don't like the registration part, I don't enjoy DCOM and I think the COM apartments in the end has confused more than it helped developers (it was originally developed to help developers avoid race conditions and related issues). But the core COM is quite decent. Some fights have been over "Is COM OO?" but that boils down to why does we use OO? IMO to give encapsulation. So the question is then: "Does COM give good encapsulation?". The answer is yes (IMO).

PS. Last I checked Firefox used something called XPCOM which looked alot like COM to me.

like image 160
Just another metaprogrammer Avatar answered Oct 07 '22 14:10

Just another metaprogrammer


You may find this Channel9 video interesting. Juval Lowy, a Microsoft COM/WCF expert says it may make sense to may every class a WCF service, akin to DCOM

http://channel9.msdn.com/shows/ARCast.TV/ARCastTV-Every-Class-a-WCF-Service-with-Juval-Lowy/

That link argues that compromises are made in terms of performance for ease of use and ease of development over time. As this trend continues, the need for low-level COM/DCOM programming is reduced. Of course this doesn't cover every scenario, but it does cover many non critical business needs.

Should you learn COM? As it stands today WCF (and other parts of .NET) is based on COM. Having an understanding of COM will help troubleshoot those low-level issues that crop up, but unless it's your primary or secondary career focus, I wouldn't spend a lot of time on it.

like image 39
makerofthings7 Avatar answered Oct 07 '22 15:10

makerofthings7