thecodegram / codegram

🚀 Codegram: A social hub for competitive coders & problem-solvers! Dive into challenges, collaborate on solutions, and expand your coding circle
https://codegram-client.onrender.com/
GNU Affero General Public License v3.0
6 stars 0 forks source link

Refactor the codebase to use module singletons / DI #4

Closed ShayGeko closed 1 year ago

ShayGeko commented 1 year ago

Dependency injection is a design pattern that promotes loose coupling between components by allowing dependencies to be injected from the outside rather than created within the component itself. This pattern is useful for creating more modular, testable, and maintainable code.

This removes bolilerplate code and makes mocks in unit tests simpler

ShayGeko commented 1 year ago

Decided to go with singletons as currently DI requires too many changes will little gain over singletons