C # Chief Designer Anders Hejlsberg Interview

xiaoxiao2021-03-06  61

In July, O'Reilly edit John Osborn participated in the Microsoft Occupational Developer Meeting. Here, he interviewed the famous engineers, Microsoft .NET frame designer, C # program language chief designer Anders Hejlsberg. Anders Hejlsberg is famous for one of the earliest languages ​​on the PC. He licked Turbo Pascal to Borland, and then led the team to develop Delphi-an extremely successful visual customer / service application design tool [Translation: You don't have to take Midas's more true J]. There is also a Microsoft C # product manager Tony Goodhew and O'Reilly Windows editing ron petrusha. Osborn: I have seen some news stories about C # [pronunciation "See Sharp"], I noticed that there are many views that seem to be like this - or theoretically -C # is Java clone is Java's Microsoft alternative. If you write this title, how do you want people to comment on this language? Hejlsberg: First, C # is not Java clone. During design C #, we examined many languages, such as C , Java, Modula 2, C, SmallTalk, etc. Many languages ​​have the same core idea we are interested, such as in-depth objects, simplified objects, and more. C # and these other languages, especially the key to Java, is very close to C . Work hard in our design. C # From C directly borrowed most operators, keywords, and statements. We also retain many language features abandoned by Java. Why is there no enumeration in Java, what is the truth? I mean, what the theoretical basis is discarded? In C , enumeration is obviously a very meaningful concept. In C #, we retain an enumeration and make it safe. Also, the enumeration is not just intellectual, which is actually a strong type of value type that is derived from the .NET base library. If there is no shape conversion, enumeration type "foo" and enumeration type "BAR" is inseparable. I think this is an important difference. We also retain operator overload and type conversion. The overall structure of C # namespace is also very close to C . However, beyond these traditional language negatives, a key goal of our design language is to make C # facing components. We join the language itself in all the concepts you need to write components. For example, attributes [translation: ie, Property, translate "attribute", which has been long. I suspect that if there is attribute, Property will not be translated into "nature", "characteristics", and Attribute is "attribute": jl], method, event, characteristic [translation: That is attribute, as of now, this noun The translation is still more confusing. Some translations and Property do not distinguish, translating as "attributes"; some translated as "characteristics"; some translated as "attribute information". Before the term translation is not unified, the author first translates it into "characteristics". Note that the translation of Attribute in XML is generally harder, that is, "attribute" (because there is no in XML, which is similar to Property, and confusion). Therefore, this paper finally describes the C # and XML portions, please pay attention to "characteristics" and "attribute" each. ] And documentation, etc., they are all-class language structures. Our work made by the characteristics is brand new and innovative. Utilization features can be added to any object to be used, and scalable metadata. This can not be seen in any other programming language. C # is also the first language that combines the XML annotation tag, the compiler can be used to generate readable documents directly from the source code.

Another important concept is what I said "One-stop-Shopping Software]. Once you use C # write code, you wrote everything in this place. No longer need header files, IDL (interface definition language) files, GUID, and complex interfaces. Because it is a self-contained unit. Once you write from this manner, you can embed your software into the ASP page or implant in a variety of different environments, which are not previously impossible. But let us return to the important concept of the component. Whether language should support attributes or events, there are many arguments in the industry. That's right, we can use way to express this concept. We can use the active behavior of the naming mode to simulate attributes with blocks such as "get" or "SET". We can use interfaces and implement interface adapters and forward them to objects. This is all possible, just like object-oriented programming in the C language. It's just that it is too difficult. It takes too many manual labor. In order to express your true thoughts, you will eventually do all your work. We think it is time, there should be a language that makes it easy to create components. Today's programmers are creating software components. They are not creating the entire application or the entire class library. Everyone is inheriting the components that inherited from the base components provided from the host environment. These components overload some methods and properties, which handle some events and install the components back to the system. Establishing these concepts is the key to the first lesson. Osborn: When you introduce C # recently, the first slide is written on the first slide: "The first part-oriented language in the C / C family". HEJLSBERG: Yes. This is one of my primary goals. We talk about everything is an object, which is also very important. It can be done like this like SmallTalk and Lisp languages, but expensive at cost. I think C # contains some beautiful and interesting innovations make the assembly development easier. For example, packages and unpacking concepts. Packing can convert a value of a value type to an object, and the unpacking can make an object to a simple type value. This is also possible in previous perhaps, but we apply it to the language is a beautiful innovation. We strive to avoid designing the C # and .NET framework with the "ivory tower". We can't afford to override all the burdens of all our software. The industry is also can't afford, especially today we are moving to the Internet era. You have to be good at using you already have. So, I think interoperability is also critical. We are committed to providing programmers with all interactive correct solutions, such as HTTP, HTML, XML, and Microsoft already existing technology. So you won't have the moment of the abyss - find some things you use under the new .NET framework, or you realize that you want to take advantage of some already existing APIs or components. You have seen we have built a language and public operation in all COM's interoperability; you have seen the existing DLL [dynamic connection library] you can use to use the DLLIMPORT feature; you have seen even if you can't You will, we also have the concept of unsafe code. Insecured code allows you to write inline C code using the pointer, you can do unsafe styling conversion, suppress memory to make it unforeseen garbage collection [Translation: Be used as verb J]. There are a lot of arguments about uneasiness to code, people seem to think that we are taking drugs or doing something else. I think this is a misunderstanding. The code will not only indicate that it is not managed because it is marked "unsafe". Of course, we will not throw out unsafe pointers to make people vulnerable from an unsafe code from the Internet. The unsafe code is deeply constrained in a safe environment. We offer such elasticity: 1. Stay in the controlled code box to complete the work without falling into the abyss; 2. Transferring into a different language using a different programming model to write the local code. If you stay in this box, we will make the code more secure because the system knows what it wants to do. In fact, even if you write unsafe code, you don't mean that you leave the managed space. Your unsafe code will become more efficient.

Osborn: Please give me more about some mechanisms that handle unsafe codes in a controlled environment. HEJLSBERG: Ok. Describe an important feature of the managed execution environment such as SmallTalk, Java, and .NET, one important feature is that they provide garbage collection mechanisms. In order to provide a garbage collection mechanism, at least a modern garbage collector, a "tag and sweep" garbage collector. You must learn more about the code being executed more than the traditional uncontrolled code. In order to find the dead object to exclude, you must be able to traverse the stack, find the root of all activities, and point out which objects are activities that are no longer accessed. However, in order to be able to achieve this goal, you must work closely with the code you execute. The code must have better descriptive. It is going to tell you how it is distributed in the stack, where is its local variable stores, and so on. When we write unsafe code in C #, you can do things that are not type security, such as pointer operation. The code marked as unsafe is not absolutely executed in an untrusted environment. In order to make it, you must grant trust, otherwise the code will not be executed. From this point of view, and other local code does not distinguish - the real difference is that they still run in the managed space. What you write is a description table, which tells you which object is an activity, so no matter when you enter these code, you don't have to cross the column border. Otherwise, when you enter non-descriptive, uncontrolled code (such as through the Java local interface), you have to set a watermark or set a barrier on the stack. You have to list the parameters of all boxes. Once you start using an object, you must be careful about what you touched, because GC [Garbage Collector] is still running in another different thread. If you don't use some concealed methods to lock objects to properly suppress garbage collectors, it may remove objects. If you forget that, then you will not be lucky. We use a different way. We said, "Let us integrate this into the language. Let us provide statements, such as Fixed declarations, which allows you to suppress objects and GC collaboration and integrate." Use this method, we provide best way, lead All existing code is forwarded together, instead of just abandoning them. This is a different design. Osborn: So, your processing method for unsafe code is - the memory of unsafe code is actually under the monitoring of the garbage collector? HEJLSBERG: Yes. However, just like the so-called "buyer is self-exclusive, no inclusion", it is not safe. You can get pointers and do something wrong - of course, you can do the same wrong thing in your local code. Osborn: I think another confusing place is to understand where C # starts from stopping and public operation. What is the innovation of C # language itself compared to it from the public operation time library? Hejlsberg: Ok, I think this confusion comes from such a fact - when people talk about Java, they don't really know which one is the runtime. When people talk about Java, confusion happens. Which language is the runtime? What is they referred to when they talk about Java? Java, language? Java, syntax? Or Java, platform? People mix these different aspects into a group. Our way indicates that we want to be a cross-language platform. We will create a platform that allows you to make multilingual programming and share a common API (Application Programming Interface).

Let us admit this, some people like to use COBOL programming, some people like to use Basic programming, some people like C , and some people will like to use C # - I hope. However, we will not try to tell you, forget all what you have done, we will not say, "Now there is only one language, there will be no innovation in this competition." We said that the industry is friendly because of elasticity. What is Java comes? Its appearance is because some programming languages ​​will also appear after it has existed before it. We want to build a platform, where you can prefer a language but will not deny the entire value orientation; we want to create a platform, it will be innovative. Who is helping COBOL programmers today? Who brought them into the web? You can only embed Fujitsu COBOL on the ASP page on the .NET platform. I mean, it is truly revolutionary! Osborn: Assume that the .NET platform supports multi-language, why choose C # instead of Visual Basic, C or even COBOL? What makes C # is coming? Hejlsberg: First, C # can make us start from a white paper. That is, we don't have any burden of backward compatibility. This is obviously simplified, regardless of the position from the implementation or the position from the use. For example, in C #, we only have a type of type and always collect it by garbage. On the other hand, the controlled C has two sets. Because it is necessary to keep non-garbage collection style programming. Therefore, in C #, you only need to understand some simple concepts. The language is an interesting thing, it is a taste; language is a serious thing, it is a way of lifestyle selection. I mean, we realize that we can't come out, "There is a platform here, you can only use a basic language." Even in that platform can be used in a language, you can do all things, people still don't like it. grammar. They may like braces or some other block dividers. That is what they are familiar. That is to make them feel comfortable and productive and ability. We treat C programmers who think that language is too complex, and the Java programmer who believes that some C and C language features will provide a option. We seek a simplified C way and invested in a multilingual platform, which provides greater interoperability, and it provides complete component concepts, and more. Goodhew: An interesting thing comes from our trace surveys of developers, more than 60% of professional developers use two or more languages ​​to create their applications. Especially when we ask what development tools they use, the answer we get is: No development language will be the terminator and all programmers will use it. As Anders said earlier, people expect some kind of grammar that can meet their or they feel. This is a personal choice. This is also the entire .NET platform concerned - provided to developers a language implementation. I think we have a beautiful job. You can basically do the same thing in Visual Basic, .NET and C #. Visual Basic is still acceptable for most programmers. C # has more activity space and is more powerful than VB. Osborn: This means more than available in C #? HEJLSBERG: Yes. It means that you can get more capabilities by unsafe code. Osborn: That is, cannot write unsafe code in VB? HEJLSBERG: Yes. No. Goodhew: However, basically, both languages ​​can do the same thing.

This is a fundamental change than Visual Studio 6. In Visual Studio 6.0, if you want to create multithreaded MTS objects, and you are a VB programmer, you have no trouble. You have to use C . Now, there is a .NET framework, you can use any language you like. Hejlsberg: This is what I have said in the general meeting, .NET framework provides a consistent programming model. During the evolution of the language and framework, we have consistently becoming a program language to kill in a specific API and a specific programming method. VB is a fast application development tool; the MFC (Microsoft Basic Class) is a subclass; ASP is plugging something to the web page. In each case, your selection of the programming model determines your choice of the program language and the available API. Every time you transform the framework, it has added the workload you learn from the new language and the API. We truly try to unify all, we provide an API, a tool that supports visual design, and we also provide an elasticity that can optionally be appropriate for your language. Osborn: I don't know what effect on those who use VBScript and JScript scripting languages? One of the wonderful things under the HEJLSBERG: .NET framework is to make the scripting language can be compiled. Take a look at the ASP , now, in fact, running the truly compiled code in your page. It is not binding, scheduled - If the user does not click on the page, you won't see the runtime error. ASP developers can use Visual Basi.Net complete power rather than VBScript. And the first time they can use Perl, Python and other popular languages ​​if they choose. Petrusha: Can the server JavaScript can now be compiled? HEJLSBERG: Yes. The Goodhew: .NET Framework enables the use of scripting languages ​​like a language with fully characteristic because they are now accessing a true programming framework and access is the same base class API. You should look at what engages in jscript implementation have already achieved anything. [Note: JScript is the implementation of Microsoft's ECMA 262 Language Norm (ECMAScript Version 3), only some small exceptions (in order to keep back compatibility), JScript is a complete implementation of ECMA standards]. Therefore, the .NET platform provides a public language framework, which has great benefits for script writingers. Osborn: We have discussed Java, C and scripts. In PDC [Translation: (Microsoft) Professional Developer Meeting], I listen to many people arguing .NET IL (IL is Microsoft intermediate language, all compilers must generate it to run on .NET framework) and run in Java virtual machines There is no difference in Java bytecode in the middle. From your conversation, it is apparent that you don't agree with this. Do you mind going further commenting the difference between them? HEJLSBERG: Ok. First of all, IL's thoughts are a very old thought. You can trace this concept to UCSD PASCAL P-Machine (an early Personal Computer Pascal implementation) or SmallTalk. P-Code has been used by Basic and Visual Basic, a component of Word, using a P-Code engine inside because it is more streamlined. Therefore, P-CODE is not something new.

I think I think we are interested in the way we use: we give you a choice - if you want - you can control the timing of compiling or translate the IL or translate into a local code. In fact, use the controlled C , you can generate local code directly from the source program. Controlled C can also generate IL, just like C # and VB. When you install your code, we give you a compilation option, you can compile the IL cost code. Therefore, when you run them, there will be no instant compilation burden. We also give you an option for dynamic running and compile code - instant compilation. With IL, it brings you a lot of convenience, such as these capabilities: porting to different CPU structures and introducing real types of security and create security systems here. I think our IL's design and the key difference between the Java bytecode is, we have made a prorating decision - no interpreter. Our code is always running locally. Therefore, even if IL is generated, you will not run the interpreter. We also have different styles of JIT. For a streamlining frame, we have eConnojit, just like we call it, it is a very simple JIT [Note: A subset of the .NET is the .NET framework, is to port it to other equipment and platform design] . For desktop, we have a full functionality JIT. We can even share a backend JIT with our C compiler. However, this will be time consuming, so you should only use them when installing. Once you make a decision to perform local code rather than interpretation, it will deeply affect the IL design. It changes the instructions that should be included, which type information should be included, and how it should be transmitted. If you look closely, you will find that they are very different from you to see two IL [translation:, In a sense, our IL is type neutral. There is no information for the parameter type in the instruction. Further, it is inferred by something that has been put. This way makes IL more streamlined. Anyway, a JIT compiler needs to know which information, so there is no reason to carry them in the instruction. Therefore, we finally made different design decisions, and this makes it easy to translate IL translation cost. Osborn: What is the difference between explanation and how you described? Hejlsberg: The core of the interpreter is a loop - some bytes from the P-Code stream, then enter a big Switch [translation: Similar to the Switch ... case] declaration: "Oh, this is Add instruction Therefore, it comes here, but this is not ... ", etc.. Interpreter analog CPU. We have reversed it, we only take a way, we have always taken a way, we translate the instructions as machine code. Now, in the case of Econojit, the machine code is actually very simple. It only creates a list of calls and stack instructions, and calls the Runtime Help, and then the runtime helper replaces this list. Of course, this code is faster than the interpreter code. Osborn: Let me use a sentence to summarize: You fully compile the code. So when you compile, bytes are fully ready to run, although the timing of translating into machine code from IL is different. HEJLSBERG: Yes. However, if it is in an environment of a memory restricted small device, it is possible to throw away. Osborn: Let us enter syntax details. I am thinking, whether the C # includes built-in support for the regular expression. I have not seen it in the language reference, maybe it may be otherwise else.

Hejlsberg: First, there is a regular expression class in the base library. We did not join any direct support to regular expressions in the language, but in fact, we have some very similar features. It is not worthwhile to do with significant processing. However, for example, when you need to specify one time - we give you this ability to write a word-word string without need to write two rear slashes each time. When you write a regular expression and when you quotation marks in your regular expression, it actually has great help. Although this help is insufficient, it is obvious that its core is in the .NET framework, and this framework can be shared by any programming language. Osborn: C # and Java namespace look different. Do they achieve the same concept? Hejlsberg: Conceptually, but it is very different. In Java, the name is also physical things, which specifies the directory structure of your source code file. In C #, physical bags and logical names are completely independent, no matter how you call your name space, it is not related to your actual code. This gives you more flexible - packing the physically distributed unit and does not force you to build a lot of directories. There are many obvious differences in the language itself. In Java, the package is also your physical structure, so the Java source file must be in the correct path and can only include an open type or an open class. Because C # does not have that physical and logical bindings, you can name your source files anywhere. Each source file can be used by multiple namespaces and can have multiple public classes. Further, you can write all the source code in a big file, or you can disperse them into a small file. Concept, C # compile what happens - you give the compiler all the source files that make up your project, then it only advances and points out what. Osborn: I have a problem about generic programming: Do you think it is an important concept? Should it be part of an object-oriented language? If so, how do you add generic program to a part of C #? Goodhew: Ok. The desire to include generic programming in the first version is limited. It is not like each person, Microsoft does not have unrestricted resources. In this first version, we have to do some difficult decisions. Osborn: How many people participate in the development C #? Hejlsberg: The language design group consists of 4 people, and the compiler group consists of another five developers. Petrusha: Frame? Hejlsberg: That's more, the whole company is involved. Goodhew: For the entire Visual Studio and .Net platform group, our department is about a thousand people. Including program managers, developers, testers, including all creating routines, frames, runtime, ASP programming models, and all others such as me, management. Hejlsberg: Aspects you just said, I clearly think that it is a very useful concept, and you can of course include all generics in academia and industry. Template is a solution to this problem. In our internal discussion, we decided to do this in the new platform. But we really like to do it to understand the genericity of the underlying runtime. This is different from how to create generic prototypes. There is no real generic knowledge in the "Erase" concept system of Java. If you understand the concept of genericity when you are running, you can share this feature in a variety of languages. You can write a generic class with C # in a place, other people can use other languages. Make a generic part of the runtime that can make you more efficiently. The ideal time for generic initialization is running at runtime.

If you use C , the initialization of the template occurs when you compile, you have two options: listen to your code expansion or try to remove some expansion code when you are linked. However, if you have multiple applications, you may forget this, you will only get expanded code. If generic knowledge is incorporated into public language, you can understand that when an application or component requests a "foo" list, it will ask: "I already have an initialized" foo "list?" ? "If so, use that one. In fact, if foo is a reference type, and we design the correct, we can let all reference type shares initialization. For value types, such as integer and floating point, we can create an initialization for each value type, but it should be done when applying requests. In order to join the generic joining, we have made a lot of design work and the necessary basic work. What you previously mentioned about IL is interesting because the decision to join generics affects the design of IL. If the IL instruction is embedded type information, if, for example, a "plus" instruction is no longer a "plus", but an integer "plus" or floating point number "plus" or a double precision "plus", you The type information is hard to reach the instruction stream, and IL is not generic in this point. Our IL format is actually a real type neutral. Also, in order to keep the type neutral, we can add generics from time to time without bringing trouble, at least not too much trouble. This is also one of our IL and Java's bytecode looks different. Our IL type is neutral. The "plus" instruction can add any two things on top of the stack. In the generic world, when it is initialized, it can be translated into different code. Osborn: Can all .NET languages ​​get generic capabilities? HEJLSBERG: Yes. The Microsoft Cambridge Research Institute has created a version of the public language and C # compiler that supports generic capabilities. We are studying how to advance them as soon as possible. The first version is impossible to join generics, we know so much. But we are working to make sure we do the right thing in the first version so that generics can apply to the entire blueprint. Osborn: C # and .NET Framework and the next version of Visual Studio schedule issued date? Goodhew: Hey, we brought technical preview to 6,500 people who came here to participate in PDC. We hope to post a beta version at some time in the fall of 2000, and then after you are ready, we release the release. One of what we do is to see how the Windows2000 release is released to let key customers come in the process of cooperative development and cooperation deployment. With regard to the .NET framework and Visual Studio.net, we will work with our customers to determine the date of the final product. We intend to let them tell us when the product is ready. And, because there is a real customer involved in this process, we will get better product quality. The unfavorable side of this approach is to make the process development and release process a bit uncertain. But this is a fundamental change. We are looking for a product issuance of breaking quality barriers, not just a date of challenging, say we have to ship. Osborn: So, not a date to complete, we are looking for a "ready departure" date? Goodhew: Yes, yes. I think developers will find that the Visual Studio.net release is one of the highest quality issues in Microsoft's history. Osborn: You have already submitted C # to ECMA [Translation: European Computer Manufacturer Association].

Is standardization really a serious goal? Do you want to use C # on other platforms? Hejlsberg: It's true! Providing C # as a possible standard to the industry is of course our goal, this is one of the reasons why we submit it to ECMA. In the process of guiding this public design with public language infrastructure, we can of course hope to get ECMA support. Regarding public infrastructure, I mean a core class library set specified in this specification. If other companies use other platforms to implement it, they have reason to find out that they can use these classes in their programs. Goodhew: I want to point out that we are doing real open standards with ECMA. When ECMA is reached for C # and public language infrastructure, the true openness will be realized under the copyright and authorization policies of ECMA. Any customer, anyone can be authorized to ECMA C # standard, subset, super-collection, and do not pay the royalty. They can be implemented in any platform and any device. We are completely hoped to do so. This is different from our competitors. They are outside the standard, looking for a certain person to print in their private language. John: I heard about breakfast and lunch: "If Microsoft did not bring COM to infrastructure, how much portability is the platform?" Hejlsberg: It is entirely possible. COM is not the standardization of C # and public language infrastructure. Not at all. C # has a completely rich model, while COM is interoperability from another perspective. However, C # and public operations have never said that there must be COM, GUID, HRESULT, AddRef or Release, and more. not a single one. The .NET public language is completely abandoned for COM, but it still gives you huge COM interoperability. Given the previous previous, I still think it will be very important, but it is not indispensable. Goodhew: I think these comments are due to the original version of the original version of our public. Microsoft wrote it in a certain meeting. At that time, we believe it is very important in accordance with the Microsoft platform. As a result, we have quoted COM and DLL many times in the specification. How DLL is a special example of how many general issues of local code on a given platform. One benefit of working with people incorporating standardized organizations and as IBM (us to formulate SOAP specifications together) is that we can do any such mention to prevent us from being killed in the future version of the specification. Locks on something like a COM frame. As Anders said, COM interoperability and COM support are extremely important to us and existing Microsoft customers. I think we have done a lot of work in the .NET support COM. However, people in the industry have read a lot of things we reference to COM and DLL words, and they are inference .NET is only designed for Windows platform, which is completely wrong. Hejlsberg: And, I think it is important that the interoperability of COM's interoperability is important for Microsoft and customers who build solutions on the Microsoft platform. The standardization of C # and public language infrastructure will allow this language to be added on any other platform. Significant interoperability. Osborn: So you will not stick to what "pure C #" and "pure .NET" implementation? HEJLSBERG: What is "pure"? How much "pure" Java application is really existed? I adventure guess, very very small. That is the number I estimate. Let us acknowledge this, people hope to take advantage of their existing code. It is impossible to tell those companies to throw away.

Goodhew: Have you exchanged with Roger Sessions? [Note: Roger sessions is the CEO of ObjectWatch, and is the author of "COM AND THE BATTLE for THE MIDDLE TIER"]. Osborn: No. Goodhew: Roger talked about the relevant chapters of the EJB specification, and there was a seller [vendor] license expansion. Not surprisingly, the seller extension includes more important aspects such as transaction management, security, messaging, and other more important. In an article [注: http://www.objectWatch.com/issue_24.htm

The sessions roughly enumerates the function of 11 fields, which is an allowable seller specification. So if you choose IBM WebSphere as your EJB implementation, your code written for your EJB will inevitably locked in WebSphere. Java is an incorrect concept of 100% pure and 100% portable. On the IBM's developer work site, there is a great interview [Translation]

http://www-106.ibm.com/developerWorks/features/gosling/index.html

]. James gosling directly pointed out this. He said, yes, the whole "Write once everywhere", "100% pure things" is a stupid idea, more is something on marketing. He said, in fact, "We don't think we can deliver all this, basically, we can't do it." This is the inventor of this language, there is no pure and portability. Osborn: Do we have a great feature or innovation that is missing some c #, are you willing to add it? Hejlsberg: About .NET framework, implied, including C #, I want to mention: it is a means of building distributed applications. It is not a long time ago, we created two class-class client / service applications, and then the object protocols such as CORBA, IIOP, RMI, and DCOM followed. This type of programming is the basis for EJB- (Corba or RMI underfighting [except for DCOM]). We have constructed such a strongly connected distributed system, but they do not have scalability. They cannot expand in the Web because they are stateful, they keep in the server, you can't transfer it to another machine, insert it and let the relevant things copy yourself. At the beginning, when we sat down and set the .NET framework, let's look back at what happened to the web. It is becoming a loose connection, very distributed world. We strive to understand its impact on potential programming models. Therefore, we have fundamentally assumed the distributed application to build in loose connection, stateless. According to this, we make the design provide huge scalability. You only expand. You transfer to more frameworks and insert them. Once this fundamental assumption is made, everything will change. It changed how to design your fundamentals, how to design your news, and even how to design your user interface. This is a new programming model. We have chosen XML and SOAP as a way to make this model. They are deeply integrated into .net. And this integration is such a core for every decision made when we are designing .NET framework, so that it is not that kind of thing that you just come in, you can go shopping. Osborn: Can you point out some places that are clear about programmers? HEJLSBERG: A quite good example is how XML is integrated into C #. Concept of C # in C # [Translation: That is, attribute, instructions on the noun translation, described above], which allow you to add claiming information to the type and member. Just like you can say that a member is public or private, you may still want to say this is a business, or this assumption is a Web Service, or this assumption is serialized in XML. Therefore, we join feature to provide general mechanisms, but we use it in all Web Service and XML infrastructure. We also give you the ability to modify the class and fields. In your class, you can say "When this type turns into XML, it should become a" this "tag name, and belong to" this "XML name space." You will have the ability to specify a field to become an element, And another attribute [translation: here refers to the properties in XML]. You can also control the XML mode [Translation: ie Schema]; control it in your class declaration, so that all additional claims can be obtained. Once in this way, characteristics are used to modify your C # code, the system can simply convert it into a specified class in XML, transfer online, you can rebuild the object on the other side when it is back. This is all done in one definition. It is not like traditional definition files or multiple information and naming modes. It is there. When you create them in IDE, it gives you a complete statement.

转载请注明原文地址:https://www.9cbs.com/read-118563.html

New Post(0)