Home >WeChat Applet >WeChat Development >WeChat public platform development WeChat public platform general development framework

WeChat public platform development WeChat public platform general development framework

高洛峰
高洛峰Original
2017-03-06 09:14:582254browse

1. Thinking

I have developed several WeChat projects and have been thinking:
How to connect WeChat-related processing with business systems?
How to separate each other and make it easy to expand?
Is it possible to develop an independent WeChat service framework to support various business applications?

2. The existing commonly used service framework

supports a variety of business applications, which we implement in a layered manner. Layer complex systems, encapsulate some functions or unique logic, and encapsulate them into different basic services or middleware. The business layer does not need to care about the specific implementation of the underlying layer. It only needs simple calls and assembly to support powerful business applications. This ensures layer independence and makes the system easy to maintain and expand. On the basis of a platform, a variety of business applications can be built. Just like building a building, once the foundation is laid, the style of the building can be various. It's like cooking. Various ingredients are prepared and can be combined in different ways to create different delicacies. Commonly used framework structures: MVC, MVVM, etc. The following is the usual MVC architecture.

WeChat public platform development WeChat public platform general development framework

3. WeChat Service Framework

However, the WeChat public platform is different from previous projects. Its implementation is no longer based on the underlying computer implementation. From the application level, it is necessary to encapsulate the upper layer of the business, that is, the display layer, front-end logic layer, and communication layer, and the real business system is below. From an overall perspective, the system supports all businesses by designing a universal WeChat service framework. Changes to the WeChat service framework are only related to adjustments to the WeChat interface. Multiple business systems share a common WeChat service framework. Here is an implementation architecture. If there are any deficiencies, please criticize and correct me.

1. The WeChat service framework is responsible for interacting with the WeChat server, including signature verification, message processing, message distribution, security policy, log processing, etc.

2. Separate the WeChat service framework from the business logic through the service interface, and register the business services to the WeChat service framework through service registration.

3. Call specific business applications through the service distributor of the WeChat service framework.

4. Business applications can be newly developed, or they can encapsulate related services based on existing business logic, and provide corresponding providers to support WeChat interfaces.

The specific framework diagram is as follows:

WeChat public platform development WeChat public platform general development framework

4. Some humble opinions on the implementation of future information systems

Just some personal opinions.

From the perspective of the long-term development of a business system, a business system will have many UI terminals. Especially with the development of mobile Internet, many functions need to be mobile. The previous PC and Web terminals already had some limitations.

With the development and deepening of cloud computing, our business services can also be deployed in the cloud. All these pose challenges to traditional information systems.

How to separate the business system from the front-end display?
How to support multiple terminals?
Is it possible to implement a set of business logic and display it on multiple terminals?

Whether you are developing a new system or new application, or expanding on an existing system, these issues must be carefully considered. Business logic needs to be more detailed and independent, and business logic needs to be extracted from the front end. In order to adapt to various terminal applications, some adaptation layers and proxy layers may need to be added. Although it is very difficult, in this period of rapid development of information technology, if you do not follow the trend, you will be eliminated by the times. So, change is inevitable. The future information system development framework may become as shown in the figure below. This is just a simple outline, and a special introduction will be made on this point in the future.

WeChat public platform development WeChat public platform general development framework


# More WeChat public platforms For articles related to developing a universal development framework for WeChat public platform, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn