GenieClient / Genie4

.NET 6 Update of Genie
GNU General Public License v3.0
20 stars 14 forks source link

Added base classes, reposistory patterns with UoW and a bootstrapper … #39

Closed d-stafford closed 2 years ago

d-stafford commented 2 years ago

Introduced a repository pattern for loading and saving data to json files. Added base classes for the settings models and repository. This will help up keep the model/entity classes as simple POCOs for the most part. For now I left the methods in the model classes just commented them out. I also mentioned in a TODO that we should maybe not do any string formatting on this side of the code and let the UI code handle that when we get there.

Introduced the unit of work concept. This may not be necessary but as we start to add the other settings like highlights, triggers, variables, gags, etc. it's nice to have access in a single injection and we can make the save logic transactional.

Finally, added an IoC bootstrapper class to clean up the service registrations. It may be necessary to build in resolvers for services later but not needed at the moment. We may also need look into removing the hosted services in program.cs to get more flexibility out of IConfiguration.

Still need to work out update/save logic. Also need to remove the config injection into formmain since that will no longer be a valid source.