Skip to content

Refactor Circular Module Dependencies #12

@caleb-vanlue

Description

@caleb-vanlue

DiscogsModule and CollectionModule have a circular dependency requiring forwardRef, indicating poor separation of concerns. This tight coupling makes modules harder to test in isolation, violates SOLID principles, and creates potential runtime initialization issues. The architecture makes it difficult to understand module boundaries and responsibilities.

Extract shared functionality to a separate SharedModule or implement event-based communication using NestJS EventEmitter. Define clear module boundaries and responsibilities. Use dependency injection tokens for loose coupling where modules need to interact. Ensure each module can be tested independently without complex mocking.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions