Skip to content

Miscellaneous Guidelines

  • Limit File Length: Keep individual files concise and focused, aiming for a maximum of 200 lines of code. Breaking down files into smaller, coherent units enhances readability and makes it easier to navigate and understand the codebase.
  • One Class Per File: Each file should contain only one class definition, promoting modularity and clarity in code organization. This approach simplifies file management and makes it easier to locate and work with specific classes.
  • Single File per Component, Class, or Screen: Ensure that each component, class, or screen in the application has its own dedicated file. This practice promotes encapsulation and maintains a clear separation of concerns, facilitating code reuse and minimizing dependencies.
  • SOLID Principles: Adhere to the SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) to design well-structured, maintainable, and extensible software components. SOLID
  • DRY (Don't Repeat Yourself): Avoid duplication of code by encapsulating reusable logic into functions, classes, or modules. DRY promotes code reusability, reduces redundancy, and simplifies maintenance. DRY
  • Composition Over Inheritance: Prefer composition over inheritance to achieve code reuse and flexibility. By favoring composition, you can construct objects with behavior provided by other classes, promoting better encapsulation and avoiding the limitations of inheritance. Composition Over Inheritance

Extra

To unlock the full potential of our new architecture, consider installing the SonarLint plugin in your IDE. Most upcoming app releases will integrate with SonarQube, and following the architecture guidelines will significantly reduce build failure. This plugin helps you align your code with the architecture early on, saving time and frustration later.