Reader Level:
ARTICLE

Language Independence from COM to .NET

Posted by G Gnana Arun Ganesh Articles | COM Interop October 03, 2001
This article covers the subject regarding Language Independence. This term Language Independent means one can create an application using various languages. This Language independent starts from past COM (OLE & ActiveX) to present .Net.Let us see in detail.
  • 0
  • 0
  • 10410

Introduction:

In this article I cover the subject regarding Language Independence. This term Language Independent means one can create an application using various languages. This Language independent starts from past COM
(OLE & ActiveX) to present .Net.Let us see in detail.

Advantages of Language Independent:

First, it helps in split up large systems into manageable subsystems early in the design phase.

Second, it assists to implement each subsystem.

Third, it lets individual teams working on each subsystem has complete.

In creating a larger application they divide the projects into modules so that complexity of the project reduces. And if one particular module is easy to done in one particular language then one group procede in that language.And if another group familiar with another language and they do their module in that particular language.Likewise after completing all the modules they made into one application by joining all those module. Think it over it is easy isn't?

In COM:

In COM we convet our application into reusable components with COM specifications So that applications can be worked in different languages such as Web applications, Visual basic, Visual C++, Visual J++,JAva
(With the help of Bridges) and so on. COM clients and COM objects have the same layout and behavior at run time, regardless of which language we use to produce the component. COM's independence from any specific language lets build systems with many different components that other programmers create in different language, whether Visual Basic,C++, or Java. The language we use to create the component simply does not matter in COM.

We must register our Com and DCOM objects within the window registry so those client programs can access the objects. If we do not register the objects, client programs will be unable to locate the object files.

When we register a COM or DCOM object within the window registry, we must reference that object's Globally Unique Identifier (GUID), which is a 128-bit (16-byte) number that uniquely identifies the object. Whenever a client program accesses a COM or DCOM object, the client program will use the GUID to reference the object within the windows Registry.

The two most notable of these technologies are OLE (Object Linking and Embedding) and ActiveX. These both use COM to facilitate all the interaction between objects. OLE uses COM to communicate between applications, allowing users to link or embed parts of one application's data and display into another application.

Disadvantages in COM'S Language independance

What ever be the benifit in the COM the Language Independent in it is somewhat limited.Let you think is there any way to derive a new COM type using an existing COM tpe.Now let us see the Language independance in .NET.

In .NET:

A common runtime engine shared by all .NET aware languages. In .NET CLR accommadates more than one languages such as C#,VB.NET,Jscript,ASP.NET,C++and also 22 other languages like Perl, Python, COBOL etc.

Source code --->Intermediate Language code(IL) ---> (JIT Compiler) Native code.

A source code is converted to intermediate language code (IL) by the respective compiler, and then the IL code is converted to native code using the JIT compiler during the run-time.Since all the code on the .NET ultimately gets converted to IL, you can use components written in one language in another language without writing any extra code!

In .NET regardless of the language you use the associated compiler emits IL instructions.For example if a c++ source code is compiled by c++ compiler it emits IL instructions and Metadata.

Conclusion:

Unlike Java,.NET allows you to build applications in a language independent manner. Eventhough now .NET is only equipped to run on the Windows platform of operating system.In near future it is possible that .NET runtime will be ported to other Non windows opeating system also.

COMMENT USING

Trending up