WEB API Application Architecture Design Analysis (1)

Source: Internet
Author: User

WEB API Application Architecture Design Analysis (1)

The Web API is an application interface framework that can build HTTP services to support the framework of a wider range of clients (including mobile devices such as browsers, phones, and tablets), an ASP that is used to build RESTful applications on the. NET Framework The ideal platform for sequencing. This article mainly introduces the framework design of ASP, but not limited to the whole Web API application architecture. NET of technology.

1, the core layer design of Web API

In the present developed application scenario, we often need to access the WinForm client, the app, the website program, and the current enthusiastic application, and so on, this data should be provided by the same service, this is what we need to build the Web API platform, based on the above requirements, Many enterprise needs are based on the concept of Web API first to design the entire enterprise application system. As the core of the whole link, Web API needs to take into account the unity, stability, security and other factors throughout the core layer.

From what we can see, the entire perimeter of the application is built around the core of the Web API, and if we put it in a different way, then that is the design diagram below, we use the app, app, web App, WinForm app as the web API interface layer above an interface application layer to deal with, this is based on an API interface layer, access to multiple or multiple ways of interface application layer, so as to build enterprise rich data service applications.

As the Web API layer as a common interface layer, we are very good to ensure that the interface application layer of data consistency, if considering the response of integrated processing, we can even put the application, app, Web application layer a set of Web programs, even in order to take advantage of their own application of the particularity, These applications can also be done very similar, so as to provide users with a unified interface representation, greatly improve the user interface experience effect, the user almost no need for additional interface learning, you can be familiar with the entire application system of the various modules.

Under the entire WEBAPI can be through the business logic layer to consolidate data storage and external interface access to two parts of the work, that is, the data access layer, the external interface layer such a hierarchical concept, if extended, we can also provide customers with some files, pictures, videos and other data storage, similar multimedia API interface , so that the interface layer of the entire Web API can provide a rich data interface for all incoming clients, thus enabling powerful and flexible access.

It is mentioned that if we consider the integrated processing of the response, we can even put the application, app, Web application layer a set of Web programs, in fact, the app layer can be divided into two types, one is the native app type, using native language such as Object C to develop iOS applications, Using Java to develop native apps for Android, there is a native framework that encapsulates a portal + Background responsive Web page, as shown in.

Compared to native applications, using the Portal Framework + responsive page, development efficiency is very fast, upgrade maintenance costs can be reduced a lot, compared to web development is much faster than using the original app development.

From the above architecture analysis, our web API as a core layer, can be developed on the above our various enterprise business applications,

In the current more popular member management, customer management and other aspects, combined with the application of catalysts, you can do more in line with the mobile trend, so as to achieve our "Internet +" application landed.

2. Application of Web API layer in WinForm hybrid framework

Similarly, in the WinForm interface, in addition to direct access to the database, as well as access to distributed WCF services, it also allows access to the Web API's data services, thus building a more adaptable and powerful hybrid development framework model.

Security is convenient, direct access to the database, not on the network public interface, they are only in a single or LAN security environment, so just to ensure the security of the database, you can generally be encrypted by the connection string to achieve a certain limit.

The security of WCF services can be verified by X509 certificates, and can also be checked with custom user names, password authentication methods, and so on.

For the Web API, because it provides a stateless interface access, and often the Web API for a variety of client access needs, may need to publish on the public network for access, so we need to pay more attention to the security of the Web API interface layer, which we described in detail later.

That is, the new hybrid development framework, in addition to the traditional mode of direct-attached database access, WCF distributed access to the WCF service access mode, you can also access the API distributed access to the Web API interface mode, their relationship constitutes a complete WinForm application system, as shown in.

The following illustration is my module analysis based on the traditional Access database approach and distributed WCF Data Service access, around the core of the hybrid framework, we can build a lot of loosely coupled modules that can provide more development efficiencies for the development integration of our WinForm applications.

The hybrid framework can be seen as an advanced version of the WinForm framework, except that it is itself a complete business system, with all the accessible modules on its periphery (such as universal permissions, universal dictionaries, universal attachment management, General Staff management ...). Have implemented this hybrid framework, so the use is very convenient, if the whole framework is simplified, it is in the original WinForm interface layer, with the interface call mode, to avoid the tight coupling relationship with the business logic class. Because it is called through an interface, it can be configured to specify an implementation that points to WCF, so it also encompasses all the features of the WCF framework. After completing the development of the Web API layer, the integration based on the Web API layer is my next stage of work.

We further analyze the implementation details of the hybrid framework, the traditional WinForm Access database and the way WCF services are accessed through a configuration module to determine whether to take direct access to the database, or to access the WCF services, they are unified to a facade interface façade layer, If you take into account the Web API layer, based on a hybrid architecture, that is, the interface on the façade layer of the facade interface to add more than one Web API to encapsulate. The architecture diagram for the specific entire framework is shown below.

WEB API Application Architecture Design Analysis (1)

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.