Back-end development engineer development specification

1 Development specification

1.1 Development process

  • clear:

    • Why do this thing, where is its value (meaning)

    • What function does this thing want to achieve, and who is the user it faces (target user group)

    • What kind of development can its function follow (long-term, function expansion)

    • The clarification and communication of requirements in the early stage are more important than the development in the later stage. Whether what you are doing is what the other party wants, and at the same time, it is best to have direct communication with the first-hand demander

    • Test to prevent incomplete testing, think from the perspective of the user, and operate with the data of the first-hand demander to achieve 100% simulation

  • Clarify requirements with demand side

  • Determine the structure

  • design document

    • Core process, life state flow

    • Interface design, confirmed with the front end

    • Database design (primary key, index, field type size, mandatory fields creatBy, creatTime, modifyBy, modifyTime, deleted)

  • development:

    • Create a mysql database table locally to ensure that the fields are correct

    • Create entity classes based on database tables, including entity struct and tableName

    • According to the entity, create a dto class, including the struct of dto, the method of transferring dto to entity, and Req, corresponding to the front-end connection req-back-end dto-entity process

    • Make sure the front end calls the url and write the corresponding router

    • Determine the interface, write the controller interface, determine the parameters and return content

    • Generate a swagger document, connect with the front end, and ensure that the front end can start developing according to the swagger document

    • Start the actual logic development of the controller-app service-service-repo layer

1.2 Naming convention

Method name:

  • PageListXxxx

  • ListXxxx / ListXxxxByXxx

  • AddXxxx

  • DeleteXxxx

  • GetXxxx

  • UpdateXxx

Enums and constants:

  • Global constants and enumerations, placed infra->constant/enumsbelow

  • The constants and enumerations in the specific domain are placed domain->constant/enumsbelow

1.3 Development Skills

1. For configurations that will change, try to write them in the configuration file to prevent re-release every time there is a change and increase convenience

2. When asynchronous processing is required, consider when uploading in batches. At this time, the network will have implementation restrictions

3. When setting parameters that require uniqueness, consider the situation of multi-person operations, whether it will lead to duplication

4. Fault-tolerant processing considerations, parameter verification, you never know what other people will do. This requires expanding and thinking about what problems will arise while implementing basic functions

5. Different logical code blocks are separated by blank lines

6. The data delete field is not physically deleted, so the corresponding query also needs to bring the condition delete=0

1.4 How to proficiently use the appropriate API

Interface document API + demo example

When encountering relevant requirements, but don’t know which corresponding method exists, and google baidu can’t find it, it is recommended to directly check the interface API documentation, and you may be able to find a method that you don’t know but can meet your needs. After all, the code The core is not to reinvent the wheel. When you feel that it is cumbersome, it is the time to optimize, and this time is likely to be optimized by others

Guess you like

Origin blog.csdn.net/qq_42647903/article/details/127573881