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

CrimeRateUpdate class should use dependency injection vs. singleton #1242

Open
ldicker83 opened this issue Aug 17, 2022 · 0 comments
Open

CrimeRateUpdate class should use dependency injection vs. singleton #1242

ldicker83 opened this issue Aug 17, 2022 · 0 comments
Labels
easy A simple task that will take minimal effort to implement task Task to be completed.
Milestone

Comments

@ldicker83
Copy link
Collaborator

ldicker83 commented Aug 17, 2022

It's easy to use the NAS2D::Utility class to get the StructureManager instance (can be seen here) but this comes at the cost of not being transparent where this information comes from and tightly coupling the CrimeRateUpdate with a poorly defined/undefined dependency.

This can be done during the construction of the object or with a dedicated function for it. It can also be done by modifying the update() parameter list to require the dependency.

@ldicker83 ldicker83 added task Task to be completed. easy A simple task that will take minimal effort to implement labels Aug 17, 2022
@ldicker83 ldicker83 added this to the v1.0.0 milestone Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy A simple task that will take minimal effort to implement task Task to be completed.
Projects
None yet
Development

No branches or pull requests

1 participant