General understanding of C #(25. Database-26. Interoperability)

Source: Internet
Author: User
Tags support microsoft

25. Library

If the language does not have a library, it is useless. C # is known as having no core library, but it uses the. NET Framework library (some of them are created using C ). This article focuses on the special features of C #, rather than. NET. To put it simply ,. the NET Library includes a wide range of threads, collections, XML, ADO +, ASP +, GDI +, and WinForm libraries. NETJ ]. Some libraries are cross-platform, while others depend on Windows. Please refer to the next section on platform support.

26. Interoperability

I think it is more appropriate to divide the interoperability into three parts: de, and the pursuit of language interoperability, platform interoperability and standard interoperability. Java is longer than platform interoperability, and C # is longer than language interoperability. In terms of standard interoperability, the two have their respective lengths.

(1) language interoperability

The ability to integrate with other languages only differs from the degree of integration and difficulty. Both JVM and CLR allow you to write code in multiple languages, as long as they are compiled into bytecode or IL code. However, the. NET platform has done a lot of work-not only to compile code written in other languages into IL code, but also to allow multiple languages to freely share and expand their libraries. For example, the programmer of Eiffel or Visual Basic can import the C # class and overload its virtual method. The C # object can also use the Visual Basic Method (polymorphism ). If you suspect that VB. NET has been greatly upgraded, and it has modern object-oriented features (with a loss of compatibility with VB6 ).

Languages written for. NET are generally inserted into the Visual Studio. NET environment. If necessary, the same RAD framework can be used. This overcomes the impression that other languages are second-class citizens.

C # provides P/Invoke [: Platform Invocation Service, Platform call Service], which is much easier than Java's JNI and C code interaction (without dll ). This feature is very similar to J/direct, which is a feature of Microsoft Visual J ++.

(2) platform interoperability

In general, this means that the operating system is mutually available. However, in the past few years, internet browsers have become more and more like platforms.

C # code runs in a controlled execution environment. This is an important technical step for C # To run on different operating systems. However, some. NET libraries are based on Windows, especially the WinForms library, which relies on many Windows APIs. There is a program porting Windows APIs to Unix systems, but it has not been started yet, and Microsoft has no clear indication to do so.

However, Microsoft does not ignore platform interoperability .. . NET Library provides the ability to compile HTML/DHTML solutions. C #/. NET is a good choice for clients that can be implemented using HTML/DHTML. Java is a good choice for cross-platform projects that require more complex customer interfaces. A Kylix-Delphi version allows the same code to be compiled on both Windows and Linux, and may become a good choice for cross-platform solutions in the future.

(3) Standard interoperability

Almost all standards, such as database systems, graphics libraries, internet protocols, and object communication standards, such as COM and CORBA, and C #, are accessible. Since Microsoft has the right or played a significant role in formulating most of these standards, their support for these standards is in a very favorable position. Of course, they will provide less standard support for commercial motives (I didn't say they are fair or not)-For something competing with them-such as CORBA (COM competitor) and OpenGL (DirectX competitors ). Similarly, Sun's commercial motives (once again, I didn't say they were fair) mean that Java would not do its best to support Microsoft's standards.

Because the C # object is implemented as a. NET object, it is automatically exposed as a COM object. C # therefore, You can expose both COM objects and COM objects. In this way, you can integrate COM code and C # projects .. NET is a framework capable of final replacement of COM-however, there are already so many deployed COM components, I believe, wait. NET replaced COM, which has been replaced by the next wave of technology. But in any case, I hope. NET will have a long and interesting history! J

27. Conclusion

So far, I hope I have given you a conceptual comparison between C # and Java and C ++. In general, compared with Java, I believe C # provides better expressiveness and is more suitable for writing code with strict performance requirements. It also has the elegance and simplicity of Java, these are also more attractive than C ++.


-Full Text-

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.