Chapter 2. NET and C # comments

Source: Internet
Author: User
I. Introduction
Windows's built-in com infrastructure (the most successful cross-language non-cross-platform mechanism) has led to a huge success of ASP Based on COM. In the future, the windows. Net operating system may push C #. NET and VB.net to the new throne.
The Web Services technology is neither original to Microsoft nor brought by. net.
The. NET Framework consists of the Common Language Runtime (CLR) and. NET Framework class libraries .. Net adds an abstraction layer on the operating system. Net itself is not an operating system.

. NET and Java competition will exist for a long time. The transition from Microsoft's pre. NET Technology to the. NET innovation process will surely eliminate some flawed developers. However, ASP and
ASP. NET is almost different. The transition from common ASP developers to ASP. NET may not be less painful than the transition from Visual Basic to visual
Basic. net.
The ultimate goal of. NET is to allow users to access the information, files, and Program .
. Net includes four important features: software change service, XML-based common language, integration of multiple devices and platforms, and a new generation of man-machine interfaces. These four features basically cover the technical features of. net.
. NET Framework is a new platform for developing applications. Including the general language runtime environment, framework class library, and Active Server Pages +

CS evolved from C and C ++, essentially. net
The C-style syntax expression of CLR semantics. Is a new type developed by MS for the. NET platform.Programming Language: Sacrifice the underlying functions of C ++ for convenience and productization. C # is undoubtedly. Net water
The most striking fish. To some extent, we can compare Cs WITH Ms's star ASP. We can use CS to develop console applications, Windows applications, and Web applications.
Sequence. CS will attract companies and individuals who are rational to the MS Platform, especially new people.

Ii. Advantages of C #
1. inherits the underlying efficient features of C ++, retains direct calls and pointers to underlying operating system APIs, and enhances enumeration. Although it is not as fast as writing system software as purebred C, it also avoids Java speed issues and JNI's clumsy calling of C ++.

2. inherit high-yield features of Visual Basic. CS is like an easy-to-learn and easy-to-use dummies automatic camera. The database buffer is composed of OLE DB
The driver is automatically managed. The components are automatically managed by MTS (DLLHOST. dll process) and. Net framkwork
Configuration configuration tools are extremely simple. For most common programmers, she has a great temptation.
3. This avoids the memory management and pointer issues of C ++, restricts pointer usage, supports garbage collection (useless memory collection), and automatic memory management.
4. Learning the CS/. NET Framework is much easier than Java/J2EE.
5. CLR supports more than one language, such as CS, VB. NET, JScript, ASP. NET, C ++. Delphi ..

6. type security: unsafe type conversion is not allowed in CS, such as converting double to boolean. value Type (constant type) is initialized to zero value and reference type (Object and class are compiled
It is automatically initialized to a zero value. array type subscript starts from scratch and cross-border check. type overflow will be checked. integer values 0 and 1 are no longer used as boolean values. the boolean values in Cs are pure true and
False. There are no more "=" and "=" operator errors. "=" is used for comparison and "=" is used for value assignment.
7. mutual compatibility: CS
Provides original support for com and Windows-based applications. allows you to use the original pointer with restrictions. You no longer need to explicitly implement unkown and Other COM interfaces.
Can be built in. CS allows users to use pointers as unsafe Code And other components in the intermediate code language can be directly used in CS.
8.
Scalability and scalability :. NET introduces the concept of parts, which have self-described functions through its "Manual. the manual establishes the identity, version, language, and digital signature of parts. parts not required
Register anywhere. to expand our programs, we only need to delete old files and upgrade them with new files. you do not need to register a dynamic link library. upgrading software components is only a task of error detection.
Modifications to the code can affect existing programs. CS supports version modifications in the language. The support for interface and method overloading makes the complex program framework develop and evolve over time.
9.
. Net on Windows
CLR is faster than Java's JRE, and it is not very strange to think of the JVM created by MS in that year. However, if the CLR speed is fast enough, the CS bytecode will run and normal applications will not feel it
The speed of access is slower than that of local code. This is what I feel. Basically, there is no obvious delay in starting and loading the Assembly through CLR, regardless of AWT, swing, SWT, and JVM.
The latency of the class library is very obvious, which is really bad, no matter sun, IBM, Bea or open Souce Community To improve JVM efficiency.
10. From the development perspective, the same project CS is shorter than the Java cycle, and it is much easier for programmers to develop.
Development Tool IDE is of great significance for GUI development and enterprise applications. Visual. Net studio is much more powerful than JBuilder/eclipse.

Java and eclipse have a SWT, but they do not have a good GUI development environment. JBuilder lacks the layout design of AWT, swing, and SWT graphics libraries. Of course
This is also an inherent limitation of Java's cross-platform requirements. pixel positioning is not supported. VS is only implemented on the Windows platform and uses pixel positioning to achieve "What you see is what you get. CS in
GUI development is better than Vb/VC (MFC) and can be compared with Borland's c ++ builder.
Integration of CS development process (SQL
Server/IIS/MTS/ie), and JBuilder needs to consider dB, app
Different software implementations of server, design EJB in the graphic designer, and import entity beans from the dB to facilitate all mainstream apps
Automatically compile, deploy, and test ejbs on the server. However, because the app
Due to the diversity of server and the high complexity of EJB deployment, Java Enterprise Development is far less convenient than CS.
These causes may lead to a J2EE project that is two or three times longer than the. NET development cycle.
11. Combined with Web development: CS can transform any component into a Web Service for cross-platform use. As a later product, CS will use HTML, XML, and SOAP (Simple Object Access Protocol) and other new webstandards are well combined to facilitate application expansion.

12. Object-oriented: CS supports data encapsulation, inheritance, polymorphism, and object interface (interface keyword in Java). (INT, float, double) in
Java is not an object, but CS introduces and struct (structs) to convert the original data type to the object int I = 1; string a = I
Tostring (); // convert (OR) Boxing
13. The variable naming method of the C # program does not encourage the use of the old Hungarian notation, but the Pascal notation is recommended, which makes the language more modern. Maybe in a language where everything is an object, adding a prefix of the expression type to the variable does not mean much :)

Iii. CS Vulnerabilities

1. the. NET platform supports multiple languages and is a commercial conspiracy from the technical and development perspectives. From the isV perspective, there is no need to support multiple languages at all, but it is difficult to maintain and upgrade the disaster recovery.
. The only purpose of multi-language support is to attract developers from other languages to the. NET platform, but you will find that CS is better to be used and may be switched to CS.
2... NET may not support other operating system platforms in the future.
CS is clear about where Microsoft is headed. Because all project compilation relies only on msil and CLS
JIT to compile the program. In this way, Cs or any msil frontend language is faster than Java at any time. However, unfortunately, program design and Compilation Program-level optimization cannot be fully utilized on non-Microsoft platforms, and we want to expand on non-
Windows platforms. net.
As mentioned above. net, IIS, MTS, SQL
server, and other MS platform software are bound to death. In the future, more Ms software will be bound, such as IE and MSN. Moreover,. Net depends on Windows very closely. Although a
open
source Mono Project is porting CLR to Linux, I can only do that, porting CLR is of little value. You need to transplant IIS,
MTS, ie, MSN, SQL Server, and other software to form a Linux platform. net, but is this possible?

therefore, the CS language and CLI specifications opened by Ms are a commercial conspiracy. On the surface, it is a gesture of embracing openness, but it is monopolized. In addition, we can see this from Ms's business behavior.
we know that Ms puts all our bodies under pressure. net and the J2EE camp, if. net is an open platform that can be freely transplanted to Linux. Why does Ms not support Linux?
what about the operating system? If the. NET
on Linux supports well and is widely used, I am afraid J2EE is only available on AIX and Solaris. It is because Ms has to lock. Net in Windows that it is afraid of
Linux. If Linux beat windows in the server market, then. NET is just a piece of cake. So now, Ms regards Linux as an eye nail and a bone in the flesh.
therefore, in addition to the pretentious attitude, Cs and CLI can be opened in ms. You can also teach more OS and CS programming. When you are familiar with CS programming, develop it for me on my windows.
3. Silly development, difficult to enter the enterprise's high-end field

Automatic Management of components is convenient, but in turn, developers lose control over component deployment. In the world of J2EE, EJB or J2EE deployment is a very important role.
It is dispensable. The running performance of Enterprise Application Software depends largely on the deployment of middle layer components and performance adjustment and troubleshooting. Therefore, the EJB component itself is a parameter that can be passed through the internal xml configuration file.
Number of auto-tuning components, app
Server provides a large number of adjustment and deployment options with a wide range of functions. For an enterprise software with strict requirements, you must provide efficient, stable, and secure operations, and perform complex operations manually.
Tunning is required. For a. Net dummies camera with only one fully automated button, there is no way to do it.
2ee, EJB is really clumsy, and the development speed is also slow, but a well-constructed and well-designed J2EE application passes through the tunning of a master, which is definitely rock solid and reassuring. The system quality is not comparable to the current. net.
In addition, the disadvantage of. NET is that, although J2EE seems to be in the snow of spring, it is actually inferior to people. J2EE can either use a strong combination of expensive commercial app server and DB, or use a free solution that is free of money. It has an impact on the low-end market. This is also a headache for ms.
Therefore, common applications use. net, Windows Server, and SQL Server. High-end applications use J2EE, UNIX, and Oracle.
4. Immature distributed domain

This is reflected in several aspects:

(1) session management for distributed applications

The. NET solution is to put the global session in a shared SQL Server by several app servers. It is so clumsy that you don't need to comment on it!
Take a good look at the memory replication technology of the Weblogic cluster !. Net is far behind.

(2). Net Distributed Components

Ms DCOM is outdated. Let's see how to implement distributed components in. net.

First, in. net, the common components and distributed components are different, and the methods used for coding are different. Common components are similar to common classes in J2EE, and distributed components must adopt TCP
Channel or HTTP channel. There are two different programming models.
Channel, because the firewall can be crossed. For J2EE applications, generally, commercial components are written in ejbs, but the distribution is not distributed. The difference is that they are not deployed on a single machine.
Already. I have not carefully studied TCP chaneel or HTTP
Channel, which is not easy to compare with EJB, but it seems that the channel's programmability and manageability are far worse than EJB.

(3) XML Web Services

Web Services on. NET adds an intriguing XML. Why do you know .. Net web
Services must rely on ASP. Net of IIS to put the components in the web directory of IIS with the suffix of asmx. When the browser accesses the components for the first time
Services is automatically compiled and released, and WSDL is generated at the same time. Programming is very convenient, but I vaguely feel that Ms Web
The services solution is also intended. What is the purpose? I think the XML web of MS is
Services is a substitute for DCOM. That is to say, Ms does not come up with a better solution to distributed components. It is easy to use CS programming and deploy at the same time.
Publish component call. In addition to the above channel scheme, the XML Web
Services is actually a distributed component of Ms. However, HTTP soap calls are still inefficient and secure, and cannot be compared with EJB calls. Besides, XML
Web services still do not solve the problem of manageability.
Services performance adjustment seems to be dependent on IIS only. Let's take a look at it. EJB is really clumsy, but it still has a lot to do with programming and management capabilities.

So now. for the Net Framework, Ms still exposes weaknesses in the enterprise field, Anders is a genius in programming language design, and turbol Pascal is designed (also my earliest and most popular programming language, he started to study in freshman year), Delphi and CS, but he is not a genius in the enterprise field.

It is not ruled out that. NET may catch up in the future. However, J2EE still has a leading edge in the distributed field, but sun is not very angry.

5. seemingly good web form

Web form is also a new technology that I think is very promising, but after the actual trial, I took a sigh of relief, "but this is the case"

The web page has poor performance due to HTML restrictions.
The form technology comes out, just like the GUI program design, to drag controls to design web pages, it seems very good, in fact there are many problems. Because the web page design and web page programming are separated
The artist uses DW to design the web page, and the programmer embeds the code. Programmers are not responsible for the design of web pages.
In this way, if the server dynamically generates HTML form elements, the artist uses DW to open the web page.Source codeAnd in visual. net
The web pages in maxcompute studio are completely invisible. Unless web programmers shoulder each other's responsibilities, the cooperation between web programmers and artists is a big problem.

6. The CS assembly is not rich enough.

The CS release time is relatively short, and it is difficult to attract a large number of opensource personnel because it comes from Ms. Currently, Java's opensource class libraries are extremely rich, almost
All the functions you can expect will certainly be able to find the Java class libraries that have been compiled by some people on the network for you to use. This advantage is also terrible. CS is not available now and will not be available in the future
Realm.

I don't know much about. net. J2EE
. Net is a hot topic with different opinions. After my superficial studies on CS and. net, I initially thought that from a technical point of view, if you are already very familiar with J2EE, you do not have
It is necessary to switch to. Net unless necessary for the market or other commercial factors. Moreover, in the enterprise application field,. NET is not doing well enough and there is still a long way to go. The future will be. net
Similar to the coexistence of J2EE, similar to Windows vs UNIX, more low-end applications use. NET and more high-end applications use J2EE.

I think the design of CS is not rigorous in terms of language. Not only language, but whole. NET architecture can give me this feeling, many aspects are to facilitate and fast development, shielding or hiding a lot of complicated implementations, and these things in Java, all programmers must handle them manually.

For a simple example, for Java RMI, you need to write the interface and interface implementation classes. This implementation class must be serializable and use tools to generate stub and Skelton classes. Remote clients only need one interace class.

In. net, you only need to write an implementation class, such as the interface class, Stub, and Skelton, all of which are automatically generated by. net. The programmer can neither see nor know its internal operation.
Status. In this case, the client must have a copy of the server implementation class. At the underlying layer, the client actually needs to implement the class interface instead of the implementation class itself.

Furthermore, if IIS is used as the remote server provider, all remote processing is written in the configuration file. Writing a local object is exactly the same as writing a remote object.

So I think. NET is like a dumb camera, and the programmer's work has been greatly simplified. What's more, there is a highly intelligent ide To Help You generate code. The improvement in production efficiency is not doubled, but five or six times.

The Java system is extremely rigorous. All the architectures are meticulous and highly consistent with the theory. The disadvantage is that it is not flexible enough, so it is cumbersome to implement and the workload is relatively large. However, a well-designed Java software is very stable and able to withstand the trial.

. NET system design is more flexible, greatly improving productivity. At the same time, it also greatly reduces the threshold for developing the middle layer of the server, so it is estimated that server programmers will be greatly devalued in the future, and this is the consequence of. Net popularization.

In addition, I found that when. Net runs transaction processing, object pools, and distributed applications, the CPU and memory resources consumed are extremely high,
The combination of APP Server (IIS, ASP. NET, COM +) and SQL Server 2000 has already exceeded the CPU and memory resources consumed by similar applications.
APP server (WebLogic Server7.0) + oracle8.1.7.

The efficiency is not much higher than that of Java based, and even the object pool is quite slow when. Net processes transactions.

C # Quick Start

Http://bbs.dvbbs.net/dispbbs.asp? Boardid = 3 & id = 452695 & replyid = & Skin = 1

C # And. net preliminary research 2004-2-10 Yankuang Group
C # Glory In 2002 Autumn

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.