[WCF programming] 2. SOA overview, wcf programming 2. soa Overview

Source: Internet
Author: User
Tags msmq

[WCF programming] 2. SOA overview, wcf programming 2. soa Overview

1. Introduction to SOA1. SOA (Service-Oriented Architecture) is both a programming method and an architectural method for software development. Based on this architecture method, an application is composed of functional units with certain behaviors (called services. 2. the basic idea of SOA is to build a coarse-grained, loosely coupled system. In this system, the service users and Service implementations are the only thing they share, is the structure definition of public service operations and parameters. 3. The client only knows the name used to describe the service method, the input parameter type, and the return value type. 4. the technical basis of the SOA architecture is the SOAP standard. SOAP uses the XML language to define the content of messages sent and received by a service operation. The message is formed by the parameter value or returned value, and the data needs to be converted to the SOAP format. Ii. Four Principles of SOA Architecture 1. Explicit boundary definitionYou can only call a contract to execute the logic in the service. A Boundary refers to the boundary between the public interface of a service and its internal special implementation. The boundary must be explicitly defined. It means that a client program only needs to know the methods existing in the service and call these methods through the contract. 2. The service is autonomous.A service is an independent program module independent of other service behaviors. Services must be deployed and each service version is independent of each other. 3. Services share models and contracts, not classes.A mode is a service operation definition. It describes a signature in a platform-independent manner: the name, parameter type, and return value type of the method. A contract is the metadata of a service and the external interface of the service as a black box. A Pattern Defines the parameter structure. 4. Service compatibility is policy-basedThis principle means that the Service determines what conditions are met before the message is processed. Policies must be used to determine communication elements, such as message format and security requirements. Policy is used to further clarify the service semantics and the client's expectations for service behavior. 3. Internal Service structure 1. How services workA service contains several methods that communicate with service users through a channel. The service user also uses a channel that matches the service channel to actually call the service method to send the required data to the service. On the one hand, the channel is the combination of modes, contracts and policies; on the other hand, the channel is the protocol used at runtime. Messages can be transmitted in two directions in the channel. A channel is always bundled with a protocol and defines the access mode and process for the service. The Protocol (such as HTTP or MSMQ) is used to transmit data, but must be supported by the operating system (such as MSMQ) where the service is implemented ). A channel is equivalent to an MPS queue where messages flow. The client places messages at one end of the channel, and the host stack of the platform where the Publishing Service is located reads messages at the other end. The channel will be bound to the mode defined by the contract. In the modes and contracts, if no metadata is defined for service operations, the channel is incomplete. The channel also needs to know the policies that must be implemented by service users. 2. Service Ecosystem1. Applications consist of services. The core of this ecosystem is services. Services are component modules that build applications. 2. Service Management Status service tasks and operations often store data persistently in the database, and then read data from the database. 3. Service Implementation Policy Service has the right to specify policies related to service logic usage. The policy describes the prerequisites for the service user behavior model. Policies can be considered as the protocol that must be achieved before the client communicates with the server. The vast majority, it is about security protocols. 4. Policy Implementation operation requirements by defining policies, the service can implement the operation requirements for calling the platform. 5. A service is bound by a contract. A service exists only when the contract describing the service operation signature exists. This contract is an agreement between the customer and the service. The contract must be explicitly defined and bound to the service at runtime. This contract is required when you create a proxy class for the client. 6. The contract describes the message exchange mode. The message exchange mode defines the transfer process and method of a message from one party to the other. The message exchange mode determines the synchronous or asynchronous call of the service, and determines whether to return results. The message exchange mode can be: Request-response mode: This is the most common mode, and each call directly returns another message. Unidirectional mode: no results are returned for a service call. Such messages can be called asynchronously. Bidirectional mode: When a method is called, the service operation can be called back to the client, and the service operation can request more information from the client program before returning the final result. The message exchange mode is visible at the function layer, so developers can perform service operations. At the deeper technology layer of the protocol, the message exchange mode exists, but is invisible in most cases. 7. The contract inclusion mode, while the mode defines the structure of the message and the structure of the Operation parameters. The schema uses the XSD document format to describe parameters. XSD is a metadata language used to describe the parameters for incoming service operations and the results returned by service operations. 8. The service exchange mode is a more complex exchange mode for describing the combination and call sequence of a message set. In this way, the message exchange mode can define which operation must be called first, which operation must be called at last, and whether to define a complete workflow for the operation. 9. Service exchange message exchange is the most important component of the Service ecosystem. Switching messages means calling an operation and receiving responses from this operation. Reference books: WCF4 Advanced Programming


How is the difference between WCF Service programming and WCF programming (version 2? Who has seen it?

Just like the difference between QQ2009 and QQ2010

WCF Service programming vs comprehensive analysis of WCF

I think you can first look at the comprehensive analysis of WCF, because I am also reading it. I think the analysis in this book is in place and is suitable for beginners.

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.