Some understandings about the structure of network design service

Source: Internet
Author: User

WebService is fundamental to iOS Web applications, where flexibility and robustness can have a significant impact on the user's experience. A well-designed service API adapts to changing back-end data sources while providing a constant façade for dependent applications. Service locators enable applications to dynamically detect new service endpoints and use them, eliminating the need to recompile and re-submit applications to AppStore. If it has to be submitted, it is generally a large-scale change that is part of the entire application life cycle. It is important to support a Versioned service API without interfering with the new version's added features.

One, remote façade mode

Remote façade simplifies application integration and allows multiple clients to share considerable application logic. For example, the postal system, which includes a large number of postman, trucks, airplanes, distribution centers and post offices, however, most of the tasks required by the user are hidden from this complexity, including mailing letters and receiving parcels. The user only needs to know how to send the e-mail separately, do not need to know how to send the past. Similarly, APIs can also request abstract objects from multiple database queries or backend systems as a separate external access method, as long as the façade's external API contract remains intact, and the underlying system can be arbitrarily changed and upgraded without impacting the façade's clients.

If a bank is merged with a competitor, the bank's existing account is migrated to the competitor's account storage System. After merging the data, the remote façade can switch to the new data source, transform any data that does not match the API contract, and then return to the app, and the user doesn't know what's going on behind it. Contract programming, he can ensure that both ends of the network session follow the agreed input and output contracts. As long as the contract is still valid, neither rewriting nor porting of the backend system will affect the other end.

Second, the service version of

The façade needs to combine all possible client application versions into the compatibility bucket, and then assign the correct API version to each bucket for its use. To simplify future development, the client version that requests the maximum version number that is known by the façade is selected as the default value, typically the most recently used API version.

Third, service locator

A service locator is a tool that helps applications dynamically probe remote source API endpoints, which resolves invalid or nonexistent endpoint issues that are hard-coded to be applied. Developers can also use the service locator to re-create new services available from previously published apps.

The first action of any client that implements the service locator pattern is usually to load and parse the file. Because all network calls require an endpoint, and the endpoint is only in the file, the file must be parsed before any other network actions occur. Locator files should also be updated when the app returns to the foreground to ensure that the endpoints and data are up to date. The app can stay in the background state for a while, and he might have loaded a service locator file before. Typically, when the service locator loads, the app displays a splash screen. So that the user experience is not affected.

Summarize:

A flexible service architecture requires careful planning and implementation prior to the release of the first version of the application to maximize revenue. If a version has a hard-coded endpoint or business logic, that configuration can be effectively supported, even if the business changes dramatically. Through the integration of remote façade, API versioning and service locator, you can change the business logic and API settings for published applications in a variety of ways. It is now easy to make minor changes to the product code and to add major new features to the new version without destroying the previous version of the application. The cost of the development of the previous server infrastructure is also not necessary, but as the application grows, it brings benefits.

Some understandings about the structure of network design service

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.