Application Structure: Concept View-2 Service

xiaoxiao2021-03-06  77

This page

Service model service design concept service is a summary of investment services

Service is a structural block for modern enterprise application architecture.

Software services are discrete units of application logic, providing messages based on interfaces that are suitable through network access. Service-based architecture allows you to use a very flexible deployment policy; service model allows applications to utilize computing resources on the network without requiring all data and logic to reside on a separate computer. This method supports many scenarios; the following is a few examples:

• Shared status between multiple client systems. Many client applications are collaborated with the shared context through the service remotely. This program is useful for the organization and cross-organizational borders. • Extend the application to a separate system. Services allows clusters and grid computing concepts to support very complex applications, or make very large data sets on a separate computer. • Simplify the deployment of application logic. Logic only needs to be accessed remotely without the need to install on all computers that may require it. • Optimize the processing on the dedicated system. Data storage and video rendering are examples of possible optimal application logic provided by hardware, which are designed or adjusted for these special purposes.

The above scheme makes the software design toward modeling and provides logic in the form of service. Even if the local running software can also be designed as a service, they can be distributed to different configurations as needed or when the system requirements are changed over time.

As the network becomes faster, cheaper and more reliable, the service architecture has evolved. At present, three main modes have been gaven from the service abstraction:

• Remote Procedure Call (RPC) The infrastructure uses a message-based service to simulate local method calls. • Distributed object system (similar to RPC) uses messages to simulate local object operations (including method calls and data member access). • Document-centric service uses messages to perform sessions restricted by protocols, usually deliver commands and data in a text-based text. The infrastructure of the Internet relies on these services to implement interoperability; these services include a Domain Name System (DNS), using a Simple Mail Transfer Protocol (SMTP) implemented mail system, using hypertext Transfer Protocol (HTTP) implementation, and scalable Markup Language (XML) Web Service.

Although all these modes will continue to play an important role in the application architecture, the XML Web Services provides several key advantages. The XML Web service provides a platform-alone method for public and use application logic, producing better interoperability, functional requirements, and operational requirements, and separate management of software units. The XML web service avoids the interoperability of the platform without limiting the dependence of the platform by specially emphasizing the line format (in XML form).

This document describes an application architecture that relies on interoperable services to provide high-value business logic and status management. If the specific techniques used are not considered, it should be assumed that the service concepts in this article include the following characteristics:

• Independent on the platform. To allow integration across different systems, the service must use the platform-independent data representation and support to access application logic in standby. For example, an XML architect specification is an example of a platform-based system for data representation. Fully in accordance with the message definition service sent and received by the service instead of modeling the service to a set of function calls to help implement the application logic access independent platform. • Based on standard. Service-dependent standards to get interoperability. The representation of the line protocol, message architecture, and secure credentials is several examples of the standards necessary. • Separate the service document with the process of metadata. Successful services provide reliable and reliable infrastructure to provide various functions, such as reliable messaging, security management, logging, and auditing. Such an infrastructure relies on access to metadata (such as routing information and response) on the requested operation. This information must be based on the standard and extracted from the application-specific state-specific status. The Simple Object Access Protocol (SOAP) is to achieve the above objects by placing metadata into header elements and putting application data into a body element. Based on these principles, build services may allow services to perform interoperability in a dynamic network of other similar services. Figure 1 is based on a message routing between different services based on consensus on data or / and metadata.

Figure 1. Services and messages

Service model

Typically, services provide both business logic, and provide status management related to issues to be resolved. When designing services, the goal is to effectively encapsulate logic and data related to the process of the reality world, making wise choices to content to be included and to be implemented as an independent service.

Because the service is called over the network, they should always be coarsely granular. That is, the service should package the substantive part of the application logic and provide the loss value caused by the lag of network requests. Similarly, the service should present a coarse particle size interface: the service should present less interface to allow a single request to execute the entire query or update, rather than presenting a number of interfaces and makes each interface less a small state.

Therefore, the main difference between service and conventional components is to call semantics. Although the object is usually modified and has a relatively fine particle size relatively fine, the service usually operates and operates a larger message. It is worth noting that the service call does not mean that the object is instantiated to handle the message, relatively reasonable and common is to process messages form in order, or to process specific portions (such as secure credentials) of the message throughout the process.

Services must be protected by the status managed, cautiously granted read and write access, and verify updates for integrity rules. The service is the "fortress" of its managed state, and is absolutely authority on how to operate this state. It is also possible to say the service to the external visitor's attitude of "health is not trust".

Status operation is managed by business rules. Business rules are relatively stable algorithms related to state (such as a method of summarizing the invoice from the list of goods), usually used as application logic.

Service is managed by strategy. Compared to business rules, the stability is poor and may be regional or for specific customers. For example, some customers who enjoy preferential customers may get discounts to goods and services. A very different example is to request the use of SSL to access the service's policy. The strategy is usually driven by the query table (although the application logic lookup and application policy is required).

Therefore, the more complete definition of the service can be: "The service is a software unit that can run on the network, which implements logic, manages status, and communication through the message, and manages the policy."

Each concept contained in this definition will explore in the back of this document. Message processing details message and message processing; policy discussion policies; state explore several state types managed by service; process the distributed process management based on service-based structures.

The rest of this topic describes the advanced concepts related to the technical benefits of service design and the pursuit of service-based structures.

Back to top

Service design concept

Service is very complicated. Perfect service design requires software architects to understand data modeling and business processes within the organization, and understand data modeling and business processing between industry sectors. The factors of the message architecture must be carefully set to reuse public elements and accurately represent state and logic related to the process of modeling. Services of cross-sectoral and organizational boundaries must solve problems such as trust, authentication and authorization. Services in cross-public networking must solve the problem of unreliability and malicious attacks in this environment. The service must be designed with scalability and can run reliably if it is very much maintained. Although the detailed guide to address these complex issues has exceeded the scope of this article, several basic issues in service design are also very useful. This document focuses on the topic will further discuss how to consider service design.

Separation of functional requirements and operation requirements

To apply policies (and manage management) in a consistent manner, you can develop an operational infrastructure that can be shared by many services provided by many of the functions. It is best to implement an operational support function for all services in your organization.

As mentioned earlier, the separation principle of the service document for processing metadata supports this separation requirement. The infrastructure service is used to process the "head" of the message and meet the operation requirements; the service-specific logic will process the header of the message and meet the functional requirements.

Figure 2 illustrates the separation of business logic and operational requirements in the service-based structure.

Figure 2. Separation of functional requirements and operational requirements

granularity

In order to compensate for the inherent lag time in the network request, it is best to design the service to perform a relatively more work at each time with the service user.

The common model of the service is to operate a large number of documents using the Query, Update, Add, and Remove. For example, the product description should be updated in a single request and provide a view before and after the document update. This is contrast with a typical object model method (which will call different accessor methods for each change attribute).

Another mode is an array that supports request and response elements. For example, a TV list service should receive a series of channels in a single request, and use a single response message to return a list of suitable tags for all have requested channels.

Service agent

The service agent is a service that helps you use other services. The service agent is usually provided by the provider of the target service, which is running in a topological manner in the location of the application that is close to the service. It helps to prepare service requests and help explain the response from the service. Service agents usually provide the following benefits:

• Easy to integrate. Contacting the proxy provided to simplify the development process. For example, the service agent can provide language binding, which makes the service call look like local method calls. • Error handling. For developers using service applications, the most difficult task is to make a correct response for error conditions. The service agent can be designed to understand the possible errors that the service may generate, which greatly simplifies integration. • data processing. The service agent can be designed to cache data in the service in an appropriate intelligence, which greatly reduces the response time of the service, reducing service loads and allows applications to work in disconnect (offline). For more detailed discussions on how to manage similar data, see Discussions on Snapshots and Reference Status in Status Documents. • Request verification. The service agent can check the input document for service requests to confirm its correctness before commit, and allow capture of significant errors without causing lag time and server load when round-trip. This does not cancel the service to verify all requests when receiving; the service is unconfirming the request is prepared by the agent, and it is unable to trust the service agent running in the "attack" environment that cannot be controlled. • Intelligent route. Some services can use the agent to send requests to a particular service instance based on the request. The content based routing will be detailed in message processing.

Not all services require a service agent, and not all users need the help of service agents, and there is only available service agents. Figure 3 Explains how the service agent is used by some services but not for other services.

These views are driven by a set of demands, which in turn generates design, development, configuration, and operational processes and systems for the system.

Figure 3. Service agent

Some service agents can communicate with multiple services; for example, brokers can request quotations from multiple insurance companies for comparison. You can use the development tool to automatically generate a proxy class from the Web Services Description Language Tool (WSDL) document; these classes are examples of simple service agents.

The service agent is related to the user of the service, and is usually closely bound to the user of the service.

Dealing with unreliability

Due to computer and networks may fail, the reliability of remote services will not be as high as software running locally. The reliability of the public network is not as high as the local area network. Request lag (i.e., the time between the service send request and the reception response) is unpopular.

Strong message processing infrastructure can be reduced but cannot eliminate the unreliability of messaging; this will be described in more detail in message processing. Operational and organizational remedies (eg, redundant services and service level protocols) are also very useful for reducing the possibility of dealing with unacceptable access or poor performance.

However, in any application where any or public network service, certain considerations must be performed for the reliability of the service. The most important principle is to support asynchronous messaging. Asynchronous message processing divides the send request and the reception response into two interactions, which may be separated by a considerable time interval. The most reliable message processing infrastructure relies on the ability of client and service asynchronous transceiver; complex processes usually involve longer lagging time, even in all networks and services are running normally according to specifications; general principles are The program requires that when asynchronous interactions is used, these interactions are designed.

Abnormal processing

Designed for failure. In the application software, the error is inevitable. The service-based structure introduces a new group of new methods that can lead to problems in things.

Carefully define the service exception, allowing many errors to be handled in programming. The client and services must also be prepared from intermediate services (eg, a reliable message processing infrastructure). Asynchronous messages will make an abnormally processed abnormally, which may be available in the process status during failure.

In an interactive application, an error that cannot be resolved by an application logic is displayed to the user. Services and non-interactive applications require some functions to submit a serious error to the operator.

Back to top

Service is investment

Design, development, deployment, management, and maintenance of reliable services require higher pre-pre-cost compared to writing independent applications. The benefits of service models in structure must reflect the value of this investment. In essence, service-based structures must have long-term cost effectiveness.

It is broad, the service is designed to be integrated. Customers, partners, suppliers and departments in large organizations, design perfect service can be used to integrate business applications (for example, billing systems) and software systems. Most importantly, the service is designed to collaborate with systems that have not yet been developed.

In a component-based traditional system, each component needs to know many of the information about other components to contact them. Therefore, it is difficult to replace a component to another component without affecting the other parts of the system. If you try to use different communication protocols, you may have a problem with different languages ​​or require regular updates.

Use messages, you can specify and agree that the line (communication) format to be used between services. This provides you with the following benefits than components implemented using functions.

• Allows interactive operations to be implemented in different technologies, allowing services to be written to each other with different technologies. • Allows you to use a service written in technology to use a service written in another technology. • Allows you to select technology when you introduce new services.

Services are run in the form of independent entities, each of which assumes different responsibilities in the system, and each service specifies its respective internal behavior. They are not shared with other services (eg, database content), so you don't need to change other services that communicate with them when you change the internal implementation of your system. Because the service does not depend on each other, they can be used to connect to a technical different system so that it may already exist within or outside the organization. This may include using available services on the Internet, you don't have to know any information about these services within the internal work mode. Control and management of different services is also independent of each other. You can install a service on a computer within your organization and manage the service independently of other services communicated with the service. This means that you can move the service to another, and will not have a negative impact on other services to simplify the management of applications. Pushing the above idea step, means you can run other instances of services on multiple computers within your organization to provide an opportunity to extend your application.

Most of the above analysis can be attributed to "service boost loose coupling". Coupling represents a plurality of things links, there is dependencies between them, and they produce certain consequences after changing. Software can have many dependencies: it relies on running its operating system, threads, and process models, other services, and other service interfaces. Good service design hides these dependencies.

The tightness of coupling is adjustable, and you must trade which factors are critical to you to determine how the tight level coupling service.

Coupling makes the changes in the system are very expensive. For example, if you have two closely coupled components, you will need to implement some changes in another component when you change one of them. If the above idea is extended to an application involving many components, the cost will be higher. If these components include external pre-packaging components, the cost will rise again. If these components span the boundaries, consider the cost of negotiation changes. Therefore, it should be reluctant to loosen the loose coupling when designing service.

Perfect designs will be better. Sometimes, the benefits of using loose coupling do not reach the additional work involved. In fact, for operational reasons, sometimes you will need to deploy and manage multiple services. For example, you can create a service based on a given address to verify postal coding. Because this is used with the address service, the following operations are very meaningful: put these two services together, make them a deployable unit, then put the combination of the two as part of the loose coupling service to the outside world.

Figure 4 illustrates the coupling option in the system.

Figure 4. Coupling options

Need to make certain hits when you choose to create a component or service, each choice has a certain advantage. From a management perspective, the degree of coupling of components is high, which means that multiple components must be managed in a unit, so it is not easy to move one component from one system to another; from a technical point of view, the degree of coupling of components is more High, means that it is difficult to bind to components written in different technologies. The degree of coupling of services is low, which will bring the benefits of previous discussion (eg, can control and manage different services individually).

Although the service-based structure has the above benefits, it is not suitable for all applications. Software architects must consider the period of the application, mapping the functional requirements and operation requirements to the appropriate technology, and select the most suitable structural mode. However, for most long-lasting enterprise applications, the benefits of service models will have the possibility to prove the value of initial investment.

Back to top

Service summary

Network innovation and investment have created opportunities to solve new categories business programs for software. These include business interactions and complex processes connected to the enterprise application.

However, traditional application development methods are not suitable for integration between mixed networks of heterogeneous systems. If you try to use RPC and remote object structures, it will cause vulnerable solutions, such solutions often require invading changes to the organization's operational steps. Modifications to similar systems have proven to be costly and require higher levels of coordination between partner organizations. The service model is more suitable for building integrated solutions. The following benefits can be provided in accordance with the services described herein.

• Independent management. This means that there is no negative impact on the system when moving or replicating services. Copy service allows you to expand. • Technology independence between users and providers. Interoperability is improved, allowing for different systems to easily communicate and share information. • Separation of functional requirements and operational requirements. The operation of the service is handled by the infrastructure, and the core business feature is included in the service. This makes the functional requirements and operation requirements, which means that different users (even different sectors) can use different parts. • Based on standard. The service is based on standard-based techniques (eg SOAP, HTTP, and XML). This means that users are not limited to only one supplier's products.

The service-based structure provides models for software to integrate and change in design.

Go to the original English page

转载请注明原文地址:https://www.9cbs.com/read-92674.html

New Post(0)