编程知识 cdmana.com

[sharing] the way of front end and back end cooperation in work? How to reduce interface changes?

introduction

I watched a lot of forums, including V2EX 、 Discussion on Zhihu , It is found that the cooperation methods of the front and back mainstream are :
1、 The front end and the back end agree on an interface document first ( If it's more automated , So you can write a bunch of unimplemented methods , And then use swagger Generating documentation )
2、 next , The front end and the back end develop in parallel , Back end implementation interface , The front end is developed according to the interface document
3、 Front and rear end joint debugging

problem

however , In the course of practical operation , There will be some problems :
The documentation phase is often very short . In the process , Developers can't understand the whole picture of the system , Naturally, it is impossible to determine the list of interfaces . With the development of front-end and back-end , These forgotten interfaces 、 The interfaces that need to be modified are gradually exposed , This increases the time cost of front-end and back-end communication .
that , In the drafting stage , Is there a systematic approach , To ensure that the need to increase is minimized 、 Number of modified interfaces ?

practice

Based on the above ideas , A lot of detours , Include Spring Cloud Contract And other technical means have been tried , Later, I discussed with the students who developed the interface management tool and found that I had made a great progress , It is impossible to reduce the interface changes of large projects . So change the angle , Try adding test drivers , Efficiency has improved a lot . In terms of literature and art , Instead of avoiding interface change, embrace change , Make change controllable and traceable .

The above picture is the front and back end cooperation process given to me by the development students after optimization , One more test driver and Mock. I tried , It's really convenient , There is no need to modify the interface through the test case ,Mock Development doesn't have to wait for the back end to implement the interface , If the code is changed, it can also be synchronized to API In the document . Here I would like to recommend the development of students home API Management tools Eolinker, and Postman It's more similar to use , But the management function and Chinese interface are more friendly , At least the front and back end of our group feel good .
Use the address :www.eolinker.com

版权声明
本文为[Wang Shu next door]所创,转载请带上原文链接,感谢
https://cdmana.com/2021/04/20210408122535394n.html

Scroll to Top