Reference some bloggers’ experience and my own development experience to summarize – keep updating ING.
Functional design
- Functions as modular as possible;
- The design of the class is as single as possible, and the function is single.
- Need UML diagrams (class diagrams, sequence diagrams, component diagrams), document precipitation;
The writing style
- Follow the pSR-1 basic coding specification laravel-china.org
- Follow the PSR-2 coding style specification laravel-china.org
- Comment!!
- Constants, env instead of hard coding
- Routing follows RestfulApi principles
- Created_at (INT type), updated_AT (TIMESTAMP ON CURRENT_TIMESTAMP, date type, automatic update), deleted_AT (default NULL)
Code distribution
1.MVC
- Model-sql processing, no business should occur
- View –
- Controller – Handles parameter validation and method calls (a more thorough approach is to create a new request class that handles validation and parameter filtering, and a control class that calls the request class)
- Service – the business
2. Upgrade version birjemin.com/wiki/php-ou…
Laravel a few things to watch out for
This is reference 2, see the link to reference 2 for details.
- Use Eloquent and collections first to manipulate and process data.
- Use standard Laravel tools that are accepted by the community
- Follow the Laravel naming convention
- Use abbreviations or more readable syntax (optional,)
- Use IoC containers or facades
- Don’t get data directly from.env (use the config() method)
Demand process
- Requirements Review Meeting
- QA to make Case, DEV time estimation, plan (class diagram, sequence diagram, component diagram)
- Review requirement Case meeting, requirement design proposal meeting
- The development of
- DEV self tests against Case (there should also be a unit test)
- Delivering QA (Functional Testing)
- acceptance
- online
- Checking the meeting
The development process
- Outgoing interface document
- The development of
- Interface self-test, unit test
- alignment
- Case self-test
- Transfer of QA
Performance optimization
1. Data level
- Use the SSDB
- Add index, read and write separation, table disassembly, SQL statement optimization
- Add the cache
- Precompute (pre-compute results, such as scripted timed calculations, real-time calculations)
- Log collection technology is adopted for asynchronous processing
- Paging for data
- Use ES to aggregate large amounts of data
2. Business
- Asynchronous instead of synchronous
- Current limiting
- Cut demand bai
3. The other
- Open opcache
The art of arguing with a product producer
Keep your mouth shut while you can
supplement
Get the product manager PM on his side
reference
- psr.phphub.org/
- Github.com/nonfu/larav…
- plantuml.com/
- www.cnblogs.com/easypass/ar…