. NET Primer

Source: Internet
Author: User
Now you may not have heard of Microsoft's new. NET strategy and feel very no face. According to the information you get from chatting with others or in your reading, your mind. NET is perhaps a magnificent architecture for the entire internet based on distributed architecture, or simply an alias for a Web application. But one thing is getting clearer, and that's what everyone is. NET, and. NET to Web and application development This means that what is becoming more and more confusing.

I dare not call myself. NET expert, but I think I have enough to intervene in its design, development process, so I can provide some useful information to help you understand. NET's positioning, purpose and goal. So while the next section does not provide development-level information, it cannot tell you how to use it. NET development program, but it does give you some guidance so that you can at least tell your colleagues or family about. Net.

Remember the past
First, we're going to go back and see how the new programming paradigm evolved to be part of the operating system. Now imagine that we are back in the early 80. At that time, the IBM PC had become one of the many choices when considering buying a computer. Its operating system is MS-DOS, and, like almost all operating systems, this is a strict command-line, text-based operating system.

While most applications worked well in the text-based environments of these early computers, some programmers began to accept the challenge of creating their own, graphical environments. The user first starts with a text-based operating system and then runs the program to switch to graphics mode. This kind of program some simple, only provides a few functions, while others are relatively strong, functional diversity.
To design and implement a set of graphical user interface (GUI) libraries for these programs, you need to do quite a lot of work. It is particularly painful to have little in common in these different implementations. To fully implement a truly powerful GUI, you need to start at the operating system level. So later, Apple,microsoft and other companies developed the graphical interface of the operating system, which not only supports the development of GUI applications, but also greatly expands the capabilities of these programs, which provide libraries not only to support the drawing of windows and menus, but also provide a wealth of system services, To make the developer work smoother. These services include device-independent print modes, even the system Clipboard, and so on, which are useful resources for developers.

I hope I have a clear view of the history and we will start here.

Back to the present
Now we jump back to the present. Imagine that the Internet is playing the role of PC in the early 80, the Web site is the original program. If the Web site just includes some hyperlinks or some text documents, it's like a text-mode program in the past, and if the site offers interactive services, it can be likened to the GUI's program. Under interactive services, the user provides information to the Web site, which is presented to the application logic in the Web site for processing and then produces a result. Examples of this are shopping carts, translation services provided by AltaVista and parcel tracking service provided by UPS, and so on.

First take a look at the shopping cart example. Almost all shopping carts will support the entry of credit card information. Often this information is recorded only as part of the transaction information, and a good shopping cart should be able to quickly and accurately verify credit card information to the credit card issuer, and if the user enters the wrong information, a reminder should be given to the user. But what happens when the Web site wants to support a new type of credit card? The site's developers must contact the credit card company, find out what they support (if any), and then write their code to match the company's electronic checksum implementation.

What about translation services? If we are writing an e-mail program, don't you think it would be useful to add an instant translation function to your program? AltaVista has provided this service site, you can quietly start a hidden browser control, give it some necessary information, and then look at the information it returned, on the return of the page to locate the translated information, and finally extract it out to provide users. This is similar to the way some graphical interface applications get information from text-mode programs or from large computer terminals. This is the widely known screen interception, which is complex and fragile, because the layout of the target screen changes, even the slightest change will pose serious problems, and in some cases this implementation is immoral.

Now let's discuss the parcel tracking service and imagine how great it would be if your site allowed your users to inquire about the current status of the goods they ordered. It would be very useful to provide this information through the UPS tracking number, or it would be a link to the UPS site, and then your users would get a detailed report of the current state of their parcels, perhaps at a time when the parcels were still crossing the ocean. But do you think it would be more convenient for your site to interact with the UPS site and then provide that information on your own site? That way, the information will share the same user interface as the rest of your site, and you don't have to worry about users accidentally getting lost in the UPS site and not knowing how to get back to your site.

In order to provide users with an integrated service experience, the examples above may require you to find ways to get their services programmatically from other companies, and then develop your own user interface for those services, or write a screen interceptor to intercept the appropriate information if a company has provided the same service through the web.
Obviously, both the code and the coupling are too large, and there are a lot of potential problems and failures that can be achieved either way. These approaches are essentially like those that forced text patterns in the 80 to interact with devices that the operating system cannot support directly.

Standard protocol
A better solution would be a common approach to interacting with remote services, not just to be able to connect to a company's services, but also to discover what services the company offers, just like XML, SOAP, and UDDI goals. XML (extended Markup Language) represents information as a format that is easy to get or handle programmatically, as SOAP (simple Object Access Protocol) is based on XML and is specifically designed to provide interface information for remote services. UDDI (Universal Description, Discovery, and Intergration) is a set of standards that the industry advocates with the ability to detect Internet services and resources.
These standard interfaces are moving forward on a long road to easy connectivity and leveraging the services that another site is willing to provide. However, since the current operating system is not yet able to support Xml/soap directly, you must skip some hurdles before using these interfaces. You can write your own xml-based compiler engine, or use someone else's, and then interact with the XML Document Object model to create and validate data being passed back and forth. It's very meaningful, and it's definitely a lot easier than turning to a screen intercept.
Into. NET
A better solution is that all xml/soap/uddi can be directly supported by the operating system, and then provided to you by the operating system as a fairly common function call or as an object interaction. For example, the following things provide an excellent way for an application to invoke AltaVista translation services.
Avtrans = new Avtranslation ("We are a sample line of text", "中文版");
strresult = Avtrans.translateto ("French");
This is. NET brings us one of the benefits. Not only does it allow applications to access and take advantage of remote web-based services directly, but it makes it easy for Web servers to provide this service to external programs. This does not mean that a Web server is provided to provide a service, and the client has to use a Web service to use. NET, except that it is more convenient to use the. NET platform for these developments.
Properties, methods, and events. Oh, my God!
. NET, of course, not just stop at the level of Internet interface. This programming model for accessing remote services is also applied to the use and internal transaction logic of local services. In other words, this programming pattern will be pervasive in the design of universal programs.
The goal is to provide a unified, component-oriented programming model. Whether you want to display a remote translation service or a native file system or a dialog box, all support will be a generic component-based interface: Properties, methods, and events. Support. NET programming languages can easily and harmoniously use these components, regardless of what language these components are developed, all of these languages are equal citizens, a VB application can invoke the method of components written in C + +, while capturing the events triggered by COBOL development applications. And collaborators are no longer aware that their partners are using a different programming language.
Yes, applications can also be divided into a number of tiers in leveraging these services and architectures. Can you imagine that you used to use a typewriter terminal connected to a mainframe, and someone explained to you what the graphical interface application was, and how quickly you would have mastered the essence of the scroll bar, combo box, and menu bar with its palette management? NET is like a new way of thinking about developing applications. If you only see a part of it, perhaps you cannot find out where it is new, and when you have acquired the knowledge of all aspects of this indivisible whole and discovered how its parts work together, you will find the immense excitement buried therein, at least for me.

I never had any intention of making this right. Net of the rough discussion into any detail. I'll look into it in a future article. NET's characteristics and capabilities.



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.