My first python web development framework (1) -- Preface, pythonweb
Since the previous experience is not very rich, the C # system written is too complex, so I always want to rewrite it. But the more I learn, the less I understand, the less I feel confident. So I have never dared to do it. I want to talk to myself in my heart, so I have to calm down and study hard and continue accumulating. Over the past two years, I have been looking for various opportunities to participate in various salons or exchange meetings. When I have time, I will chew on technical books or read some articles or source friends, and I will try my best to learn from the bloggers.
Due to work relationships, C # has been rarely used in the past two years and has been engaged in product design, project design, and architecture design. At the end of 15, the company had the opportunity to participate in the development of a small project, I used the web version of TMS developed by the python language and liked python. After experiencing the convenience of python development, we will now have the second and third web projects for python development.
Under the guidance of O & M colleague Xiao Dai (O & M Master), the first project took three days to learn the basic python syntax, and then spent one day to get familiar with the Python framework written by Xiao Dai, I immediately entered the development and writing business. It took about a month to complete and launch the project planned by the company. The first python framework to be learned is a lightweight, straightforward, and simple framework (you can go to Xiao Dai's blog http://www.linuxy?com/to learn more, with detailed tutorial and source code ), the code of this framework is designed to make it easy for beginners to understand the purpose of each line of code, so that they can easily get started with development and maintenance and reduce the difficulty of system maintenance. Through the development of this project, I will re-reflect on the advantages and disadvantages of the code and framework I wrote earlier. I will use too many technologies and models to make my framework look powerful, however, the entry threshold is very high. Although there are many documents and comments, it is not so easy to learn and use them flexibly, and it is difficult to maintain them, on the contrary, the original encoding method makes people feel another way.
Since the first project was completed well, the company soon arranged the second python project. With the previous project experience, I found that the original framework had a lot of repeated code and the code reuse rate was not high. So it took three weeks to refactor the underlying project, developed a brand new ORM module based on your own needs, restructured many tool functions, optimized the data-layer code, and added the logic layer, integrate multiple projects in the IDE to share the same module code as needed ...... of course, this process has encountered many pitfalls and completed the first version of the python rapid development framework. Then, using this framework and another backend developer + 10 front-end developers (android/ios/web) completed development of a medium-sized project in about three months, and run the test online.
The life of an entrepreneurial company was short. In March October, the company entered liquidation. The company dismissed all its employees and returned to work in Guangzhou at the invitation of the Guangdong old club, the Guangzhou Company's business is complicated and the original system's scalability is not strong. Every time a telecom operator is added, it has to deploy a set of similar code. If the APP is connected to different carriers at the same time, you need to deploy multiple sets of services similar to those connected to different carriers. That is to say, the more services you deploy in cooperation, the more service providers x n app partners = xx services. It is difficult to maintain and data cannot be shared. You need to re-develop a system to replace the original system. Because of the high speed and convenient maintenance of python development, my third python web project is also the first distributed microservice architecture project that I designed independently, after more than a month of hard work, the original python framework was fully restructured and rewritten. python Quick Development Framework Version 2.0 was finally released. Then, with the joint efforts of another colleague, it took one month to migrate and develop the business functions of the old system to the new system, and deliver the functions to the customer. This seamless and smooth connection with the old APP of the customer.
I often think about the process of learning and using python for development. A good framework uses various packaging, design patterns, and object-oriented principles and guidelines, however, it is difficult for a beginner to quickly start business development immediately.The code is concise and reusable because of more encapsulation, and the result is reduced readability and comprehensibility.If you do not have a complete document or spend a lot of time learning about it, it is hard to understand it. In the past two years, I have been trying to learn the frameworks written by others and the tutorials written by others. Although I have more than a decade of development experience, I often feel unable to learn them, it is very difficult, because after obtaining a source code, it is found that the amount of code is too large to start. This does not happen when you use the framework you write. Why? After thinking deeply, I found that the framework I wrote was not complicated at the very beginning. It was also very simple at the beginning. After the development experience has been accumulated, in order to cope with the constant reconstruction and modification of various business conditions, gradually become more complex and more powerful, and the readability of the Framework is gradually decreasing. When such a framework is learned by others, they do not understand the development history of the framework, but do not know many functional modules, variables, parameters ...... the reason for this design is that you do not understand the relationship between modules, functions, and functions. It is difficult to grasp the new framework quickly. Therefore, even if you have learned how to use and develop a new framework, you do not know how to modify the bugs in the framework. Let alone modify the underlying unreasonable aspects of the framework based on business needs.
In order to make it easier for colleagues to learn and fulfill their commitments, this series of articles is available.
This series of blog posts focuses on a little cainiao who just learned python and started outsourcing and wrote a very simple web enterprise website. With the development of this enterprise, the demand changes constantly, and the transformation and reconstruction continue constantly. The enterprise website becomes a small e-commerce platform and a large e-commerce platform (whether to write a large e-commerce platform is not finalized for the time being, it is also possible to develop an enterprise management system ). The Code is also transformed from a simple code that cannot be simply a few lines to a mature framework that can cope with various business needs and quickly complete development tasks. Of course, there are also various pitfalls and obstacles in the middle. I hope everyone will like this story and grow together with cainiao.
This series of articles will be divided into several parts. The first part focuses on some basics, development knowledge, development environment and running environment, and the code will be very simple and direct; the second part focuses on refactoring, that is, the protagonist has grown up a little and found a lot of repetitive Code. In addition to some prominent events, the system needs to be reconstructed to improve the system functions; the third part is that with the development of enterprise business, IT will become more and more dependent and put forward a variety of requirements to improve the system. The fourth part is the theme of change, with the improvement of the system, we will find that the Code becomes complex in this process. To cope with the explosive growth of data and access, the existing architecture system cannot load, and we need to change the system framework, upgrade the server architecture and system framework to develop and change the distributed, high-availability, and microservice architecture. If there is still part 5, we will explain the enterprise architecture, IT systems increase user behavior analysis, business data analysis, and other big data analysis systems based on the enterprise's development strategy and existing business capabilities to promote enterprise development.
From the perspective of Enterprise Architecture maturity, the first and second parts are in the project-driven technology stage, and all are dominated by project decision-making. The third and fourth parts are in the business-driven stage, the business starts to rely on technology, and the technology is improved and promoted according to business needs. The fifth part is the strategy-driven stage. enterprises gradually become familiar with the technology and will use data analysis for strategic decision-making, technology also plays an increasingly important role in enterprises and guides the development of enterprises through big data.
As I usually work very busy, I am not sure if I can write these parts temporarily. I can only take one step. There should be no problem in the first two parts. The latter two parts involve too much content and are difficult to plan. There may be a large number of chapters. If you can't finish writing them, you can also join the group to discuss it.
Author: AllEmpty
Source: http://www.cnblogs.com/EmptyFS/
If you are interested, you can add the python development QQ group: 669058475. Let's discuss it together. If you have any questions, you can ask questions in the group. Of course, if I am busy at work, I may not reply in time.
This article isAllEmptyOriginal, you are welcome to reprint, but you must keep this statement without consent, and provide a connection to the original article clearly on the Article Page, otherwise you will reserve the right to pursue legal liability.