Build your own communication framework — Introduction
Since my work, I have been doing business development under the framework set up by others. I have gone through the source code of the framework and generally understood the implementation principle. However, only by doing so, it is difficult to understand the author’s thinking when designing, and it is easy to ignore some technical details. Therefore, I came up with the idea of developing my own framework. This is not to build a wheel repeatedly, but just to put myself in a higher perspective, In the process of design, it drives deep thinking. For the first project, I’m going to develop a communication framework and write a series of articles to record my thoughts and choices in the design process.
A simple MVC communication architecture based on netty
Support websocket protocol
Custom protocol package format
client requestAsynchronous serial lock free
Dependencies and tools
My own project is not considered to be used in actual production, and new features will be used as much as possible in the development process
The ability of gradle’s custom script is quite convenient. There is a place in my plan that I will use. Moreover, gradle script supports groovy, so I can learn this language
Excellent communication infrastructure.
It can be used in language independent, platform independent and extensible communication protocols, data storage and other fieldsSerialization structure data format
Test framework, written more concise
Toolset, there are many easy to use tools
Dependency management, logging, monitoring, etc.
Leave out get, set, constructor, etc
Develop in the following order
- Custom protocol format for interaction with client
- Request, response encapsulation
- Nettyserver build
- Asynchronous serial lock free
About a week ago, I began to write this framework, but after a few days of writing, I found that this is not right, the development process is not right, and often wrote that I found that this is not right, there is not right, and a lot of thinking has been slowly forgotten. After reflection, I decided to combine the article to review the whole design process. Encourage each other.
In this paper, the blog group issued a multi article and other operational tools platformOpenWriterelease