Microsoft. NET strategy and asp.net introduction (3)

Source: Internet
Author: User
Tags html form http post http request iis soap new features object model web services
Asp.net| Microsoft | strategy? Form Application Template

Conceptually, the top of the service framework is the two application templates: The Windows Application template and the network application template. While I focus on using the Microsoft. NET framework as a way to develop network services and network applications, the framework can also be used to develop more traditional windows-based applications (which, of course, can also use network services).
Developers who write Windows client applications can use the win form Application template to take advantage of Windows rich user interface features, including current ActiveX controls and new features of Windows 2000, such as transparent, layered, floating windows. You can choose a traditional windows or network appearance. Knowing that it is similar to the current windows-based form pack, developers will find the win Form programmable template and support for the design phase intuitive.
Win forms take advantage of microsft. NET Framework runtime to reduce the overhead of windows-based customer applications. As long as applications and components are written in win or used by a win form application, they can be safely executed by the Framework security template on the client. If used or executed in this way, a game that someone downloads from the internet will not damage the configuration information or data, or it will automatically send e-mail to everyone in the user's address book.
Microsft. NET Framework assembly template simplifies the configuration and versioning of applications. Applications can be configured to use the shared components they are compiling and testing. Instead of using any version of the component that happens to be installed on the client machine, this improves the reliability of the application and reduces the main factors that the application supports: incompatibility between user interface controls and other shared component versions.

? Network Application Templates

Built in Microsft. NET Framework, a common application template is shared with network applications. In this model, a Web application is a set of URLs originating from the base URL. It therefore contains network applications and network services for generating Web pages viewed in the browser. In this section, I'll detail a network application programmable template called active Server pages+ (asp.net)
As you guessed from the name, ASP. NET is developed from the Active Server page. Asp. NET leverages the common language runtime and service framework network applications to provide a reliable, automated, extensible host environment. Asp. NET also benefits from the common language runtime integration template, simplifying the application configuration. In addition, it provides services that simplify application development, such as state management services, and high-level programming templates such as ASP.net Web Forms and asp.net Web services.
Asp. NET's core is the HTTP runtime language, a high-performance running language for handling HTTP requests based on low-level architecture, similar to the ISAPI architecture provided by Microsoft Internet Information Services (IIS). As you can see in Figure 5, the HTTP runtime language is a controlled code that runs on an unmanaged host such as IIS on the server or IE on a client computer. The HTTP runtime handles all incoming HTTP requests, resolves the URL of each requesting application, and then assigns the request to the application for further processing. The HTTP runtime language is multi-threaded and handles requests asynchronously, so poor application code cannot prevent it from processing new requests. and the HTTP runtime language assumes that failure must occur, so it is controlled to automatically recover from access conflicts, memory leaks, deadlocks, and so forth, as much as possible. Unless it is a hardware failure, the goal of running the language is 100% reliability.
Asp. NET uses component-based microsft. NET Framework, so it obtains such advantages as Xcopy compounding, component parallel compounding, and xml-based compounding. Asp. NET Another major advantage is that it supports real-time updates of applications. An administrator can update the application file without shutting down the network server or even stopping the application from running. Application files are never locked, so files can be overwritten even while the program is running. When the file is updated, the system is gently converted to the new version. The system detects file changes, creates a new application instance with the new application code, and then routes the incoming request to the application. When all outstanding requests processed by an existing application instance are processed, the instance is destroyed.
In an application, an HTTP request is passed through a pipe path of the HTTP module and finally arrives at the request handler. HTTP modules and request handlers are managed classes that implement special interfaces that are defined by asp.net. This piping structure makes it easy to add services to your application: Just add an HTTP module. For example, security, state management, and tracking are implemented as HTTP modules. Advanced programmable modules, such as network services and network forms, are usually implemented as request handlers. An application can link to multiple request handlers-one URL per handler, but all HTTP requests are routed through the same pipeline.
The network is essentially a stateless model, and there is no connection between HTTP requests, which makes it difficult to write network applications, because applications often need to maintain a state across multiple requests. Asp. NET enhances the state management services introduced by ASP to provide three types of state for network applications: Applications, sessions, users. As in ASP, application state is specific to an application instance and is not persisted. Session state is specific to the session between a user and the application. Unlike ASP session state, ASP. NET session state is stored in a separate process and can be configured to be stored on a separate machine. This makes the session state useful when the application is extended in a network cluster (Web farm). User State is similar to session state, but usually it does not time out and is permanent. Therefore, user status is useful for storing user parameters and other personalized information. All state management services are implemented as HTTP modules, so they can easily be added to or removed from the application pipeline. If additional state management services are required in addition to the services provided by ASP.net, they can be provided by a third party module.
Asp. NET also provides high-speed buffering services to improve performance. Output buffering can completely save Web page translations, segment buffer storage section of the Web page. Because the corresponding classes are provided, applications, HTTP modules, and request handlers can store any number of objects in the cache whenever necessary.
Here's a quick glance at the two Advanced programmable modules built on the asp.net programmable module: asp.net network forms and asp.net network services.

? asp.net network form

Network forms bring the high productivity benefits of forms based on visual Basic to the development of Web applications. Network forms Support Traditional ASP syntax that mixes HTML content with corner code, but it proposes a more structured approach to separating application code from user interface content. The introduced network form controls are used to provide a mechanism for encapsulating common user interface elements. These new features enable the development tool to support the design time module while supporting the VB small application, so that the WUSIWYG tool supports the page layout.
The Network form control is responsible for building the user interface, typically in an HTML form. Asp. NET provides a set of network form controls that map traditional HTML user interface widgets (including list boxes, text boxes, and buttons) and a set of more complex network controls (such as calendars and ad boards). An important feature of these controls is that they can be written to fit the client's capabilities; the same Web page targets a wide range of client platforms and form factors. In other words, network form controls can "sniff" customers who are looking for a form, and then return to the appropriate user experience-either HTML3.2 for low-level browsers or dynamic HTML for IE5.0.
Considering that the network is a stateless join model, a complex problem facing network application developers is that they respond to the interaction of the user with the Network-based interface. The network leverages the ASP.net architecture to provide a rich set of services to help developers build interactive Web pages. The net effect of these services is to make component-based, event-driven programmable modules, which are very much like client-side form programming for developers. The complexity of the state management of user interaction with Web pages is hidden by asp.net network forms and network form controls. For developers, the rich data-binding services provided make it easy to display data from data access services.
The separation of code and content enables ASP.net Web pages to be dynamically compiled into controlled classes to improve performance. Each incoming HTTP request is passed to a new Web page instance, so the developer does not need to care about thread security in the code.

? asp.net network services

The ASP.net Network Service architecture provides an advanced programmable template for establishing network services with asp.net. Although it is not necessary to use a network service platform to establish a network service, it offers many advantages that simplify the development process, and the programming model it uses is familiar to developers working with ASP or VB. With this programmable model, developers do not need to understand HTTP, soap, or any other network service specification.
Developers build a network service by using ASP.net to generate a file with an. asmx extension and compounding this file as part of a network application. The asmx file either contains a reference to a controlled class that is defined elsewhere, or contains the definition of that class. This class is derived from the WebService class provided by ASP.net. When the public class method WebMethod the attribute on the tag, it becomes a network service method, which is invoked when the HTTP request is sent to the URL in the asmx file. You don't have to create a contract for your Web service by hand. When requested by the caller, the ASP. NET checks the metadata of the class to automatically generate an SCL file.
Customers can submit requests via soap,http get and HTTP post. The conventions for encoding methods and parameters are: For HTTP GET, will be encoded as a query string, and HTTP POST will be encoded as form data. The mechanisms of HTTP GET and HTTP POST are not as powerful as soap, but they make it unnecessary for customers to support soap when accessing network services.
The ASP.net Network service model assumes a stateless service structure. Stateless structures are generally more scalable than stateful structures. Each time a service request is received, a new object is generated, the request is converted to a method call, and the object is destroyed when the method call returns. If these services need to maintain state across requests, they will use the ASP.net state Management service. asp.net network services run in the network application model, so they get all the security, compounding, and other benefits of the model.
The ASP.net Network Service also provides a managed proxy tool that generates classifications for the network services described in the SCL file. The Agent builder maps the messages described in the SCL file to methods in the managed class. The agent hides all network and boot devices from the application code, so using network services looks just like using other controlled code. The proxy will use the SOAP Link Network Service preferentially, but it also supports HTTP GET and HTTP POST mechanisms. Therefore HTTP GET and HTTP POST can also be used.
Network Services provides a simple, flexible, many-standard model for using existing architectures and applications for binding applications on the Internet. Network applications are easily integrated with locally developed services or existing services, regardless of the development platform, the development language, or the object model used to implement any of the components of the service or application.
Microsft. NET Framework provides an application template and key technology to simplify the establishment, deployment, and continuous development of secure, reliable, scalable, and highly available network services on top of existing developer skills.
With the above description, we can feel Microsoft. NET will have a great impact on our future programming.
1.1.3 ASP. NET history
Before we tell about ASP.net history, let's review the ASP.
The first version of ASP is the 0.9 beta. It brings a storm to web development, which can embed code directly into HTML, making it simpler and more powerful to design Web pages, and can be powerful with built-in components, most notably ActiveX Data Objects (ADO), It makes it easy to build a dynamic page like a child playing a game.
The final appearance is active Server Page 1.0, which is sent free of charge for the IIS affiliate product. And will be widely used on Windows platforms soon. The combination of ASP and ADO using developers can easily create and open a recordset in a database. This is no doubt that it is so quickly accepted by the general public, because you can now use these scripts to create and open a recordset, processing and output any data, in any order, almost as long as you can think of, it can be done.
1998, Microsoft also released ASP 2.0. The main difference between ASP 1.0 and ASP 2.0 is that external components need to be instantiated. With ASP 2.0 and IIS 4.0, it is possible to build an ASP application, and each component has its own separate memory space. The built-in Microsoft Transaction Server (MTS) is also easy to use for making components.
Microsoft then developed the Windows 2000 operating system. This version of Windows brings us IIS 5.0 and ASP 3.0. This is not a simple supplement to the ASP, the core of the difference is actually a lot of things to the COM to do. In Windows 2000, Microsoft combines MTS with COM's core environment to make COM +, which gives the host a new way to use components, which also brings more stability to the host, and becomes a highly efficient work platform that can be upgraded. IIS 5.0 does not seem to change anything on the surface, but the operation on the interface is relatively large. Internally, it uses COM + Component Services to provide a better environment for the execution of components.
With all this, Microsoft has launched asp.net,asp.net, also called asp.net, not a simple upgrade to ASP, but a new generation of active Server Pages from Microsoft. Asp. NET is part of Microsoft's new system knot. NET, where a new technology architecture makes everyone's programming life simpler


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.