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

Dependency injection and inversion of control #322

Open
ekolis opened this issue Sep 28, 2024 · 2 comments · Fixed by #323
Open

Dependency injection and inversion of control #322

ekolis opened this issue Sep 28, 2024 · 2 comments · Fixed by #323
Assignees
Labels
breaking This change will break savegame compatibility. technical debt Things that would make the code cleaner but deliver little to no value to users.
Milestone

Comments

@ekolis
Copy link
Owner

ekolis commented Sep 28, 2024

What needs to be cleaned up?

Implement dependency injection (DI) and inversion of control (IoC) by adding interfaces for classes in the core projects and moving the implementations (concrete classes) to external projects that can be referenced via an IoC container. Perhaps also split up the core projects into a hierarchy of smaller projects.

How will this benefit us?

Make the code much more clean and modular. Allow for replacement of sections of the game's code (e.g alternate combat mechanics) by flipping a configuration switch in the DI configuration.

What potential drawbacks are there to making this change?

It's a lot of work to go through and untangle all the dependencies and add interfaces for everything. Will surely introduce some bugs. Splitting up projects might make debugging harder.

@ekolis ekolis added technical debt Things that would make the code cleaner but deliver little to no value to users. breaking This change will break savegame compatibility. labels Sep 28, 2024
@ekolis ekolis added this to the alpha-10 milestone Sep 28, 2024
@ekolis ekolis self-assigned this Sep 28, 2024
@ekolis ekolis linked a pull request Oct 20, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from To do to Done in FrEee Core Oct 20, 2024
@ekolis
Copy link
Owner Author

ekolis commented Oct 20, 2024

Opening again, there are more things to add DI to

@ekolis ekolis reopened this Oct 20, 2024
@github-project-automation github-project-automation bot moved this from Done to In progress in FrEee Core Oct 20, 2024
@ekolis ekolis pinned this issue Oct 20, 2024
@ekolis
Copy link
Owner Author

ekolis commented Oct 20, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will break savegame compatibility. technical debt Things that would make the code cleaner but deliver little to no value to users.
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

1 participant