Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use factory methods instead of bulky constructors. #1

Open
UnnikrishnanBhargavakurup opened this issue Dec 5, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@UnnikrishnanBhargavakurup
Copy link
Collaborator

When dependencies are injected via the constructor, it can result in bulky constructor arguments. Factory methods enable us to replace specific dependencies with mocks or stubs during testing without modifying the constructor. This approach is particularly useful for tightly coupled components or when dependencies are created internally.

@UnnikrishnanBhargavakurup UnnikrishnanBhargavakurup added the enhancement New feature or request label Dec 5, 2024
UnnikrishnanBhargavakurup added a commit that referenced this issue Dec 7, 2024
Replaced long constructor dependency injections with dedicated factory methods to improve readability and maintainability.
Related to #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant