Software Design and Specifications
Design
Database Design Principles
API Design Principles
An API should do one thing
Why: If an API can do more than one thing, it can lead to messy and error-prone code. Also, it is less readable and maintainable.
How: Don’t do different things by passing different parameter values.
Development
Development Specifications
Dependency Versions
Use a common parent maven project to manage the version of dependencies.
Why: Easy to update all project dependencies to the latest version. Easy to remove vulnerable dependency versions for all projects.
Configurations
Use OS environment variables or external configuration files to configure all external resources like databases.
Why: Avoid exposing sensitive information.
Trivial Files
Generated trivial files should include in the gitignore
, or put out of the project.
Why: Make sure the source code is clean and easy to commit code.
Unit Test
Unit test code should be able to be executed directly without preconditions like creating a database.
Why: If unit test code can’t be executed directly, test code become hard to use.
Configurations
Need changed static configurations (key-values) should read from dictionary table of database or project configuration files
Why: Hardcoding makes code difficult to extend and maintain.
Test
Deployment
Operations
Database
Before execute a delete
SQL statement on product databases, must make sure the data is correct by executing a select
SQL rewrite by the delete
SQL.