Summary : the. NET Framework is the next-generation platform that Microsoft uses to build distributed Web applications and Web services. Outlines the fundamentals of the . NET Framework used to build distributed applications. Highlights the basics of the . NET Framework : The Common language runtime (CLR) and Microsoft intermediate Language (MSIL), and the core of the . NET Revolution : Web Service. Finally , the process of building a distributed application with good scalability by using the . NET platform is given in a concrete step.
Keywords :. NET; Distributed computing ; Web Services ; CLR; MSIL
The distributed Application Based on. Netplatform
LI Hao-chen, Chenhe-bei
(College ofcomputer Science&technology,wuhan University Oftechnology,wuhanhubei430070,china)
Abstract:The.NETFramework Ismicrosoft ' s next-generation platform for building distributed Web applications and Web Servic Es. This article presents an Overviewon the. NETFramework ' s basic principle for building distributed applications. The point related the. NETFramework ' Sfoundation:commonlanguageruntime (CLR), MSIL (microsoftintermediatelanguage), andthe core Ofthe.NET
Revolution:web service.finally, Throughthe concrete step, providedthe processthat constructedthe distributed Applicationofthegood flexible function based on the. Netplatform.
Key words:.net; Distributed Computing; Web Service; CLR; Msil
1 Introduction
WhenInternetTechnology in particularWebTechnology in -Century -When the Middle Ages became the mainstream of technology,The model of business computing has changed dramatically,The focus of this change is on the traditional client/Server(Client/server)The computational model has a huge impact. First of all,Client/Server architecture requires significant cost of maintenance,Especially when the client is in a different region;Second Client/Server mode does not have very good scalability,Because the client/The number of client users that the server structure can support has a certain limit,When the number of client users exceeds $The time,Client/The efficiency of server architecture starts to fall,This is forinternet/intranetand e-commerce and other applications,This limit on the number of client users is unacceptable.
:web The model is loosely connected by a layer of information and application collections into and the information and applications reside on a wide variety of hardware platforms. internet technology can achieve rapid development Its fundamental motive force is that it can provide users with a scalable, scalable and highly available public information delivery platform. This platform is designed to be very flexible and not limited to one or two compute tiers.
In response to the rapid development of internet/intranet , Microsoft has released a 6 -month period called Microsoft.NET Next-generation software and services strategy that leverages Internet-based distributed computing and communication surges to orchestrate the many smart devices and websites through advanced software architectures , using network protocols and formats to provide simpler, more personalized and more efficient internet services.
Through the research on the development of the most frontier of distributed architecture , This paper expounds Microsoft's latest . NET platform Architecture.
2. NET Platform Framework structure
a network project should have the following features Span style= "FONT-FAMILY:CALIBRI;" >: can interact with the user Processing some data And keep its state somewhere. Thus it is divided into three layers : appearance layer (Presentation layer) , transaction logic layer , data service layer (Data layer), or more layers. Compare the three-layer structure with a single structure can see that the latter binds the abstract concepts of transaction logic and user interface together.
The . NET Framework is a new computing platform that contains all the layers of software development on the operating system that provide the component technologies that Microsoft platforms ( or any platform ) have seen, Rendering the richest level of integration of technology and data technology , the entire architecture has been created to be easy to develop in highly distributed Internet environments , just as with traditional desktop systems.
The . NET Framework is designed to achieve the following goals :
Provides a consistent object-oriented programming environment , regardless of whether the object code is stored and executed locally , executed locally but published on intenet , or executed remotely.
Provides a code execution environment that minimizes software deployment and version control conflicts.
Provides a code execution environment that guarantees code , including code created by unknown or incomplete trusted third parties, to execute completely.
Provides a code execution environment that can eliminate the scripting environment or explain the performance issues of the environment.
Make the developer experience consistent across applications that are very different types, such as Windows -based applications and Web -based Applications .
Generate all communications according to industry standards to ensure that the . NET Framework-based code can be integrated with any other code.
Figure 1 shows the . NET Framework.
. The NET Framework has two main parts: the common language runtime and. NET Framework class library.
2· 1 Common language runtime
The common language runtime (Common Language RUNTIME,CLR) is the foundation of the. NET Framework, and can be thought of as a proxy for managing code at execution time, providing core services such as memory management, thread management, and remoting. It also enforces strict type safety and other forms of code accuracy that ensure security and reliability. In fact, the concept of code management is the basic principle of the runtime.
If you have heard of the virtual machine, you will be aware of the JVM (Java virtualmachine), Java cross-platform features, in fact, using the principle of virtual machines. The so-called virtual machine is a generic virtual machine that contains only the instruction set. Through the virtual machine, the medium/high-level language program can be compiled into the machine language program of the virtual machine, and then through the virtual Machine Runtime (execution Environment), the machine code can be converted to local execution of the machine code of the physical machine.
The Microsoft intermediate language (Microsoft Intermediate Language,msil) is the equivalent of a virtual machine's machine code, which is the language of a virtual machine that is not related to the machine platform or the operating system. No matter which language is used to compose a program when used. NET development tool compiler to compile the program, the program will be compiled into MSIL format.
With MSIL, cross-language collaboration can be achieved. For example: we can use the C # language and system integration features to design the core of the program. In addition, in the front-end part of the program, the use of Visual Basic features simple, rapid development, you can let the program staff quickly develop a beautiful program interface, and in the VB project to reference or inherit the C # design of the core part of the program. Since all programs can be compiled into MSIL languages, and all language compilers can read the information of MSIL, it is possible to integrate the previous C # project with the VB project in order to complete the integration between different languages. At the same time, due to the MSIL in the use of Win-dows platform using PE (portable executable) based on the expansion of PE, the program metadata (summary information) are written into the executable file, so that the current MSIL program has a self-explanatory ability, Make the system no longer dependent on the logon database. This approach can not only reduce the previous "DLL Hell (Dllhell)" problem, but also facilitate the system of the management of the program, reducing the burden on users.
If the intermediate language is a virtual machine language, then the common language Runtime (CLR) is an instance of this virtual machine, that is, the runtime to execute the virtual machine language. The core of the CLR is an execution engine that loads, executes, and manages code that has been compiled into an intermediate byte code format that is not interpreted and compiles the cost machine binary code by an instant compiler built into the CLR before execution.
This means that in the. NET has two levels of compilers, the language compiler gets the source code and creates MSIL, and this MSIL byte code can be ported to any. NET platform, which is then compiled by the instant compiler into binary code to facilitate machine execution.
2· 2 . NET Framework Basic Class Library
. NETFramework provides a set of operating system-level object function libraries that can be used by program language calls, which provide services and object models for data input/output, security, and so on. For example, the next generation of ADO, called ADO, resides here. Also included is the core functionality of working with XML, including the parser and XSL converters. An important feature of the NETFramework class library is its close integration with the programming language, which integrates the class library into all of the. NET-enabled programming languages, so that all languages have a common object function library. This allows programmers in the future to learn to write programs, only need to learn the grammar rules of the language and program flow can, as for the other, because it is called the same library, the required method is almost the same, which for the traditional program developers, it is undoubtedly a new experience.
3. NET's web technology
Microsoft.NET is Microsoft's third-generation Internet-facing technology platform. The third-generation Internet feature will be "Programmable Web (Programmable Web)", where individual sites can be more tightly integrated with each system. Business-to-business, supply-chain (supplychain), application service provider, etc. will also be implemented, and these Web services can be used in a variety of portable devices (such as mobile phones, PDA and information appliances, etc.) on the implementation, truly "information everywhere, readily available" realm.
3· 1 ASP
ASP (Active server Pages) is a Microsoft-developed server-side scripting environment based on windowsnt/2000 and IIS (Internetinformationserver). Is the most popular open Web server application development technology today. ASP is neither a language nor a development tool, but a technical framework. The main function of ASP is to be able to combine scripts, HTML components and powerful Web database access functions to form an application that can run on the server and send HTML pages specially crafted by user requirements to the client browser.
The ASP's workflow is roughly: when the browser requests an. asp file from the Web server, the server calls ASP; The ASP reads the requested file thoroughly, executes all the server-side scripts, and merges the script output with the static HTML code, and the final HTML page is passed to the browser in the HTML response.
Asp. NET is developed by ASP, but it differs from ASP in essence, it has the following points mainly:
ASP belongs to an interpretive programming framework whose core is VBScript and JavaScript. The limitation of these two scripting languages determines that the ASP cannot perform the underlying operations like the traditional programming language. Asp. NET is a compiled programming framework, in addition to the same as ASP can use VBScript and JavaScript as a programming language, but also use vb.net,c# and JScript.NET even COBOL and other compiled language to write, This determines the power of the ASP, which can perform many of the underlying operations.
Because the ASP program is interpreted to execute, and thus its execution efficiency is relatively low, and the ASP. NET program is compiled and executed, so the efficiency is much higher than ASP.
ASP code is not enough structure, which mix the HTML code of the display interface and the client and server script code, not only the program is difficult to maintain, and debugging is also a big problem; Asp. NET uses event-driven and data-binding development methods to separate program code from the displayed content, making the ASP more concise and more readable.
If a COM component is used in an ASP program, the program's deployment process becomes complex because the component is registered before it is used, and some information about the component (such as the location of the component file, the threading model, and some error codes, etc.) is logged into the system, and DLL traps (Dllhell) are configured and maintained The problem arises; in ASP. NET, there is no need to consider the issue of component registration, as long as the related files are copied to the target machine, the deployment operation is simplified.
ASP does not support WebService, while ASP. NET supports Web Service.
3· 2 Distributed object Structure
As the use of the network matures, developers are beginning to address some of the issues like scalability, reliability, and adaptability with the traditional flat format programming model. Multi-tier development begins to meet the data, data processing, and users of disparate applications on different computers connected by local area networks, allowing for increased scalability and reliability through the growth and redundancy of the software.
The innovation of the concept of program design promotes the evolution of software engineering, and the distributed object structure will be born accordingly. Distributed object structure can be said to be the combination of standard object structure and remote program invocation. When the main program calls the object, through the mechanism of distributed objects, to deal with the underlying network communication problems, the master program locates the remote computer where the object is stored and initiates the object in the remote computer. After the remote computer finishes executing, the distributed object mechanism returns the return value to the main program. All of this is almost transparent to the client side of the calling object, and it does not clearly feel that it is fetching the object at the far end.
The distributed object structure evolved from the initial RPC (remote Procedurecall, remote program invocation) to the most popular CORBA, proposed by the OMG (Objectmanagement Group) organization, Microsoft introduced the DCOM technology and Sun company launched the Java-rmi and so on. All of these distributed object architectures, because they allow enterprises to reuse existing functionality, and provide encapsulated object methodologies to prevent changes to one business logic affecting another business logic, thus significantly reducing development time and cost. At the same time, applications that apply distributed objects can reduce maintenance and client burdens due to the use of similar manageable orb objects.
But the concrete to each object structure standard, also has the different characteristic and the limitation. For example: DCOM because it is a COM-based ——— used in the most popular desktop object model, and included in the operating system, making it a low-cost, widely popular in the Windows platform. However, there are problems with DCOM itself, first of all, the customer Telecom transmission function, most firewalls do not allow DCOM call through, unless you have the opportunity to get the source code or to request remote components locally, there is no way to query DCOM to understand whether the methods and properties are available; DCOM does not have a standard data transfer protocol. The COR-BA of OMG organization, although it is widely liked by academia because of its cross-language and cross-platform features, it is because of the compatibility of the openness, which makes the standard difficult to realize, which leads to the lack of interoperability between object Request broker. And because CORBA is not integrated into the operating system, it increases the cost of software deployment.
Considering the differences between the performance of the network and the characteristics of the programming environment, Microsoft has introduced a new standard for its distributed object Architecture ——— SOAP. SOAP (Sim-pleobjectaccessprotocol, Simple Object Access Protocol) is the communication protocol between objects and information exchange. Compared with the previous DCOM, on the communication protocol, because of its standard application and the standard HTTP protocol of WWW service, rather than the dedicated DCE RPC specification of DCOM application, it can make it through the firewall, thus greatly reducing the work of network management; On the communication port, SOAP uses the port 80, while DCOM uses PORT135; On information encoding, SOAP changes the NDR encoding rules used by traditional DCOM, and uses the international standard of XML as the encoding rules for information passing, allowing developers to create custom tags for hierarchical data transfer in a similar HTML format. Can say: Soap=http+xml.
3· 3 XML Web Service
Microsoft.NET's ideal is a global distribution system that uses XML in a single application like adhesive, allowing functionality to run across organizations and even across the world on different computers. In this scenario, the system from the server to the wireless handheld computer, and everything in between, will share the same common platform, for all of them. NET versions are available, each of which can be transparently integrated with other parties.
WEB Services is the mechanism for achieving this ideal. In Web services, software functionality is presented as a service that does not care who the consumer of the service is (unless there are security considerations), and Web Services enables developers to build applications for overall integration and distribution of solutions. The central business elements of enterprise applications can be managed locally, while services that support them (such as user authentication, file storage, user preference management, calendars, mail, and so on) do not need to be managed locally and can be ordered seamlessly.
Xmlweb Services is creating a new era of distributed application development, Xmlweb Services is a programmable entity that provides specific functional elements such as application logic, and any number of potentially disparate systems can use common Internet standards ( such as XML and HTTP) to access it. Xmlweb services can be used internally by a single application, or it can be exposed over the Internet for any number of applications. Because it can be accessed through a standard interface, Xmlweb Services enables heterogeneous systems to work together as a single compute network.
In the. NET architecture, Web services transforms into a component service, which makes traditional web roles change, and web users are no longer just general users or browsers, but new types of applications, as shown in 2.
As you can see from Figure 2, Xmlweb Services is an application that uses standard protocols such as HTTP,XML,XSD,SOAP and WSDL to provide the ability to exchange messages in a scalable, loosely coupled, and stateless environment. XML Web Services makes it possible to build modular applications within and between companies in a heterogeneous environment, and enables these applications to interoperate with various implementations, platforms, and devices. SOAP-based XML messages for these applications have explicitly defined portions (structured and typed) or parts that are not strictly defined (using arbitrary XML). Without breaking the protocol, the ability of the message to evolve over time is the basis for the flexibility and reliability of xmlwebservices (Xmlwebservices as a building block for future web).
Xmlweb Services enables data exchange and application logic remote calls by using XML message processing to enable data to pass through firewalls and move data between heterogeneous systems. Although remote access to data and application logic is not a new concept, doing this in a loosely coupled manner is a completely new concept. The only assumption between the client and Xmlweb services of XML Web Services is that the recipient understands the message it receives. This way, programs written in any language, using any component model, and running on any operating system, have access to Xmlweb Services.
Under the. NET architecture, Microsoft uses the WSDL (WEB services Description language,web Services Description Language), a language developed in XML to describe to users the services provided by WEB services, and relies on disco ( Discovery of Web Services) regulates how the user program obtains the WSDL for WEB services, and finally builds a cross-industry, cross-platform, open architecture ——— UDDI (Universal description,discovery and integration), allowing WebServices's vendors to publish their services on top, allowing Web services users to find Web services of interest to them.
4. NET platform for distributed Applications example
One possible scenario for developing a distributed application is to create one layer at a time, mostly starting from the data tier, then moving to middle-tier business rule objects, and finally creating the user interface layer. Confined to space, this example takes the development of a social security module in a hospital information system (HIS) as an example to provide a brief description of the process of creating a distributed application:
(1) First, the data layer is generated. In this system, Microsoft SQL Server 2000 is used to build the database.
(2) Then create a middle-tier business object. The created business objects will run on the Web server, providing the performance and scalability required for distributed applications. In addition, the business object will be implemented as Xmlweb services so that clients can communicate with the created business objects from any platform using standard Internet protocols. The specific steps are:
① Create ASP. Netweb Service project. In this component, you create a connection to the data store and get the data instance through the dataset.
② Create and configure database connections and dataset schemas. Add two objects to Xmlweb services: SqlDataAdapter and SqlConnection. The connection object creates a new connection to the database, and the data adapter queries or updates the database and sends the results to the dataset DataSet object. This dataset will be used to display the data in the Web Forms page.
③ exposes datasets from business objects. This action makes the dataset available for use by Windows or Web applications.
(3) After creating a middle-tier business object for data access and exposing it as xmlweb services, the next step is to create the client interface. The system creates a Web Forms page. You create a Web Forms application and add controls such as Datasets and DataGrid and buttons to a Web page, and then you set the properties of the control and write the appropriate code.
(4) Finally, run the application and deploy the solution.
5 Concluding remarks
. NET is a distributed development platform environment which is oriented to network and supports various user terminals. Microsoft's grand goal is to get. NET radically changes the way the software is developed, the way it is distributed, how it is used, and the software becomes a service.
NET's core is to build a new generation of Internet platform, to solve the problem of collaboration between sites, so as to maximize access to information. NET through the introduction of Web services, so that programmers can see the Web service on the network as the building Block of the program, so as to build a more dynamic, more timely applications, which will challenge the traditional development model; Also make a new relationship between software developers and users, that is, through the Internet to connect the long-term cooperative relationship, which will also have a huge impact on the entire software industry business philosophy, and for the entire software industry to bring unlimited business opportunities, in this sense,. NET's emergence is undoubtedly a profound revolution.
Reference Documents:
[1] Li Qing • Fully explore the Microsoft.NET technology strategy [M]. Beijing: China Youth Press, 2002 ·
[2] [Mei]robert Powell Richard weeks.c# and. NET architecture [M]. Beijing: People's post and post publishing house, 2002 ·
Based on. The research of distributed application of the net Platform