Nexus-Mods / NexusMods.App

Home of the development of the Nexus Mods App
https://nexus-mods.github.io/NexusMods.App/
GNU General Public License v3.0
1.05k stars 47 forks source link

Design Code Reuse friendly solution for Game Support #420

Open Al12rs opened 1 year ago

Al12rs commented 1 year ago

Epic

Currently there aren't many generalized solutions in place to avoid code duplication when adding new games. This is particularly evident for games that share many similarities (eg. bethesda games).

The goal would be to avoid code replication and make the addition of games with similar features as simplified as possible.

These systems would be optional (no forced interfaces for games that might not need them) and ideally be designed in such a way to not require modifications when support for a new game is added, so that all changes required for the addition of a game would be localized to new classes implemented for the game. (For example, a generic mod installer should not have a hardcoded list of games that it supports)

Some areas of overlap:

Greg-Nexus commented 1 year ago

An approach we can take here is, when we add a game that uses similar patterns to one we already support, refactor the code to be more generic and reusable. We don't want to end up with 50 mod installers when we could have 5.

Al12rs commented 1 year ago

If we can manage it I would like to try to design a solution that would avoid future refactors as much as possible from the get go.

Greg-Nexus commented 1 year ago

If we can manage it I would like to try to design a solution that would avoid future refactors as much as possible from the get go.

I strongly agree with this. The less tech debt we generate as we go, the better.

Al12rs commented 1 year ago

A potential solution approach was defined here: https://github.com/Nexus-Mods/NexusMods.App/issues/489#issuecomment-1658215845