Skip to content

Instantly share code, notes, and snippets.

@ra0van
Last active February 20, 2020 13:02
Show Gist options
  • Save ra0van/cbd9bed6f954c0f2bbcb02bae7fe7889 to your computer and use it in GitHub Desktop.
Save ra0van/cbd9bed6f954c0f2bbcb02bae7fe7889 to your computer and use it in GitHub Desktop.
PR Guidelines

PR Guidelines

Business layer/ Domain Layer

  • Define interfaces or contracts for DB Layer.
  • Inject Dependencies for Infra & Db layer from api/application layer
  • Avoid tight coupling between components
  • Single responsibility for components/classes/functions
  • Invert all dependencies for better control & unit testability
  • Use Data Transfer Objects/Intermediate objects for transfer between layers & components.
  • Avoid accessing config files directly. Use dependency injection.

Sql queries & DB layer

  • Use parameterised queries
  • Use prepared statement.
  • Using enums & Lk tables in db
  • Avoid joins on LK tables by maintaining enums(for better performance)

Unit Tests

  • Code Coverage of atleast 80% on all business layers

Written with StackEdit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment