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

Source: Internet
Author: User
Tags definition soap microsoft sql server object model require resource versions visual studio
asp.net| Microsoft | Strategy 1.1.2.3 Basic module of Microsoft. Net

? Network services at a glance

Generally speaking, a network service is just a service-through the Internet standard this service can with other
Network services are integrated together-a simple application that is distributed. In other words, it is a resource that can be positioned via a URL to automatically return information to the client that needs it. An important feature of network services is that customers do not need to know how a service is implemented. In this section, I will explain how network and network services combine the best aspects of component-based technology and describe the basic framework needed to communicate with network services.
Like components, network services provide "black box" functions that can be used again without concern for how the service is implemented. A network service provides an exact definition of an interface called a contract, which depicts the services provided. Developers can combine remote services, local services, and set code together to integrate applications. For example, a company can use the following services to build an online store: Microsoft Passport (Original: Passport) services to authenticate users, third-party personalized services to enable Web pages to match each user's parameters, credit card processing services, sales tax services, package tracking service for each shipping company, Link internal Inventory services within the company's internal stock management program, as well as a small set of code to make their stores stand out.
However, unlike today's component technologies, network services do not use specific object model protocols, such as DCOM, RMI, or IIOP, that require a clear, homogeneous, basic architecture of the server and client. Although implementations that are tightly coupled with specific component technologies are well accepted in a controlled environment, they become impractical in a networked environment. Because the participants in an integrated business process change and technology changes over time, it becomes difficult to ensure a single, unified architecture among all participants. The network service takes another approach, using the ubiquitous network protocols and data formats, such as HTTP and XML, to communicate. Network services are supported by any system that supports these network standards.
Furthermore, the Network service contract describes the services provided in the form of a term message, which is generated and accepted by the network service, rather than describing how the service is implemented. By focusing on the message, the Web service template is completely ignorant of language, platform, and object templates. Network services can be realized by using any set of programming languages, object models, and complete sets of features of the platform. Network services can be used on any platform by applications implemented in any language. As long as the contracts used to interpret service capacity, message sequences, and desired protocols are identified, the implemented network services and Network service users can be different from each other without affecting the application on the other end of the session.
Network Service templates have low requirements for minimal architectures to ensure that network services are implemented and accessed on platforms that use any technology and programming language. The solution to the interoperability of network services can only rely on network standards. However, to make it easier for applications to use network services, it is not enough to simply agree to access network services through standard network protocols. Network services are easy to use when network services and network service users rely on standard ways to represent data and commands, represent network service contracts, and calculate the capacity provided by network services.
XML is an obvious choice for defining a standard, extensible language for providing commands and typical data. Although you can define rules that use other techniques, such as encoding as a query string, to represent commands and typical data, XML is specifically designed to describe the standard meta language of the data. Simple Object Access Protocol (SOAP) is an industrial standard that uses XML to represent data and commands in an extensible way. Network services can choose to use SOAP to determine the format of the message.
XML is a kind of enabling technology of network service contract. The Service Contract language (SCL) is the XML syntax for recording Network service contracts. Because the SCL is xml-based, it is easy to generate and interpret contracts for developers and development tools. A draft of the SCL rules will soon be introduced (note: Now soap Toolkit for Visual Studio 6.0 supports earlier versions of the SCL called SDL).
The DISCO specification describes a standard way for a service provider to publish a network service contract and the corresponding mechanism, which will enable developers or development tools to find the contract literature. When you read this, disco's draft code should be introduced.
Standards like soap, SCL, and disco help developers because they do not need to understand and implement the way each of the network services they use is accessed. Better, fully tested, high-performance architectures that support these standards will be provided by the development platform, which can greatly simplify the entire development process.

? MicroSoft. NET Framework

MicroSoft. NET Framework is designed to make it easier for you to set up network applications and network services. Figure 2 shows the Microsoft. NET Framework of the system. A service built on the top of the operating system is the common language runtime that manages run-time code requirements, which can be written in any modern programming language. Runtime offers a number of services that help simplify code development and application development while also improving application reliability. The. NET framework includes a set of class libraries that developers can use for any programming language. On top of this are many application templates that provide advanced components and services specifically for developing network sites and network services.

? Common Language Runtime

The Run language (runtime) is transferred in and runs code written in any running-aware programming language. The code that runs as the target is called the Controlled (managed) code, and the controlled code simply means that there is a defined cooperative contract between the internal executable code and the running itself. Tasks such as generating objects, invoking methods, and so on are delegated to the running language, which allows additional services to be added to executable code in the running language.
The running language features cross language integration, self-describing components, simple compounding and versioning, and integrated security services.
The runtime language uses a new universal type system that expresses the semantics of most modern programming languages, and the common type System defines a set of standard types and rules for generating new standards. The running language knows how to build and execute these types. Compilers and interpreters use the Run language service to define types, manage objects, and make method calls, rather than using tools or language-specific methods.
The main design of the type system is to enable multiple languages to be integrated deeply. Code written in one language can inherit the implementation of classes written in another language, exceptions written in one language can be captured by code written in another language, such as debugging and profiling, which works in a completely closed environment, regardless of the language in which the code is used. This means that developers who write reusable class libraries no longer need to generate a version for each programming language or compiler, and developers using class libraries are no longer limited by the libraries developed for the programming language they use.
self-describing Components--now Microsoft. NET Framework-simplifies development and compounding, and improves system reliability. Many of the services provided by the running language are driven by metadata and information that is used to supplement executable code. Because all the information is stored together, only executable (code) is called a self-describing component.
One of the main advantages of self-describing components is that they do not require additional files. The definition of a class does not require a separate header file, and the definition of the class by examining the metadata can be obtained from the component itself. Accessing components across a language or process boundary does not require their own IDL files, type files, or proxy/stubs; the required information already exists in the metadata. In order to identify the service attributes requested by the developer, it is not necessary to expand their configuration information. Most important, because metadata is generated by source code during compilation and stored with executable code, it is always synchronized with the executable part.
In addition to improving the configuration of individual components, microsft. NET Framework defines an application configuration template to solve the complex process of setting up application installations and DLL versioning (often referred to as "DLL Hell"), the running language provides services that support this template.
Microsft. NET Framework introduces the concept of composition. A composition is a set of resources and types, and includes metadata about these resources and types, which is also formulated as a unit. Metadata is called a list of combinations, and it contains information that can be seen in groups such as types and resource tables, and this list also includes information about dependencies such as the version number when the composition is established. A developer can specify a version policy to indicate whether the running language loads the most recent version of the assembly that is already installed on the system, to mount a specified version, or a version that is used at compile time.
Multiple copies of a software component can always exist on the same operating system, but, generally speaking, only one copy can be registered, transferred into memory, and executed by the operating system. For systems, the strategy for locating and paging into memory is global. The. NET Framework Common Language Runtime adds the necessary architecture to support each application policy that manages the positioning and transfer of components, which is often referred to as parallel compounding.
A combination can be private to an application or shared by multiple applications. Multiple versions of a combination can be configured on the same machine at the same time. Application configuration information defines where to look for a composition so that runtime can load different versions of the same combination for two different applications that run concurrently. This eliminates the problem caused by the incompatibility of the component version and improves the stability of the system as a whole. If necessary, the administrator can increase the configuration information for the assembly of the compounding time, such as a different version policy, but the raw information provided at compile time will never be lost.
Because the assembly is self-describing, there is no need to explicitly register on the system. The application is simple enough to simply copy files to the directory (a little more complex if you have to install an organization without an organized component in order for the application to run). The configuration information is saved in an XML file that can be edited by any text editor.
Finally, the running language also provides a complete, pervasive security service to ensure that unauthorized users cannot access resources on the machine and that the code does not perform unauthorized actions. This improves the security reliability of the system as a whole. Because the running language is used to load code, generate objects, and execute method calls, the running language can conduct security checks and enforce security policies when controlled code is loaded into memory and executed.
Microsft. NET Framework not only provides code access security, but also provides for role-based security. With code access security, developers can specify the permissions necessary for the application to complete work. For example, your code might require the right to write files or access environment variables. This information is stored at the compounding level along with information about the code flags. When the code is loaded into memory and the method call is executed, the run language verifies that the permissions required by the code are given. If not, a security conflict information is logged. The policy of giving permission, which is called a trust policy, is established by the system administrator and is based on evidence about the code, such as who published the Code, where it was obtained, and the code flags found in the assembly and the permissions it requires. Developers can specify permissions that they obviously do not need to prevent others from maliciously using their code. If the required permissions are dependent on information that will not be known until the runtime, then the security check can be written to the neighborhood.
In addition to code access security, the run language also supports role-based security. role-based security establishes the same permissions templates as code access security, except that these permissions are based on the user's identity rather than on the code's flag. Roles indicate the class to which the user belongs and can be defined at the development and compounding stages. Policies that give permissions are assigned to each predefined role. At run time, the identity of the user is determined and the code will run on behalf of that identity. The running language determines which role the user is a member of, and then gives permissions based on that role.
In view Microsft. NET Framework's programmable templates, look at the services it offers first.

? Service Framework
Above the common Language Runtime is the service framework, which provides classes that can be invoked by any modern programming language. All classes follow a set of naming and design guidelines to significantly reduce the learning curve of developers.
The framework includes a set of base class libraries that developers want to exist in the standard language library, such as collections, input/output, strings, and data classes. In addition, the base class library provides classes that access operating system services such as drawings, networks, threads, globalization, and encryption. The service framework also includes data access class libraries, and development tools such as debugging and profiling services that can be used by classes. This article does not discuss all of the classes in detail, and I focus on the data access classes because most network services require access to the data. Of course, you can find additional information about the Service Framework class library in the Microsoft. NET Framework SDK.

? Data Access Services
Almost all network services need to query and update persistent data, whether in simple files, related databases, or other storage types. To provide access to data, the service framework includes the ActiveX Data objects+ (Ado.net) class library. As the name suggests, ADO. NET is developed by ADO. Ado+ is designed to provide data access services for network-based, scalable applications and services. Ado. NET provides high-performance APIs for connected pointer-style data access and also for connectionless data templates that are better suited to return data to client applications, as described later.
Just like the rest of the sections, ADO. NET defines the classes that link the Data Warehouse, send commands to the Data Warehouse, and obtain results from them. These classes are implemented by the managed data provider (managed-provider). The links and command objects in ado+ look the same as in ADO, and a new class named DataReader provides the ability to get results through high-performance API streams. DataReader is functionally equivalent to the same, read-only ADO recordset (Recordset), but DataReader is designed to minimize the number of objects generated in memory to improve performance and avoid garbage accumulation. Contains the managed data providers for Microsoft SQL Server and any data warehouses accessible through OLE DB in the. NET framework.
Ado. NET, a major innovation is the introduction of Datasets (Datasets). A dataset is a high-speed buffer in memory that provides a data graph. Datasets are ignorant of data sources and can be generated and populated by programs or by the transfer of data from the Data warehouse. Regardless of where the data is obtained, the dataset is manipulated by using the same program template, and it uses the same potential data buffer. Use. NET platform developers can replace the disconnected recordset in traditional ADO with a dataset.
The managed data provider exposes a DataSetCommand interface object for the Data Warehouse and dataset. Dataadpter uses ado.net links and commands to populate data sets from the Data Warehouse and resolves changes that occur in the dataset to the Data Warehouse.
Just as DataReaders shows a valid stream access for related data, XmlReaders shows streaming access to XML data. Developers use DataNavigator to scroll and edit XML documents in memory. DataNavigator is functionally the same as the common Document object Model (DOM), but it is more efficient and provides an object template that maps relational data tables well. DataNavigator supports XPath syntax for navigating data streams. Ado. NET provides a XmlDocument class for developers who want to continue using the DOM as an XML object template instead of using a more efficient datanavigator template.
Because all data can be considered XML, developers can use conversion and validation services for any data. Ado. NET defines a common conversion system that consumes datanavigator and generates a new XmlReader. The. NET Framework provides a special transformation component that supports the Global System XSL Transformations (XSLT) rules. Ado. NET also provides a validation engine that uses XML diagrams to confirm XmlReader. Ado. NET supports diagrams defined by DTDs, XSD, or XDR.

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.