C
C#12mo ago
Alisa

❔ Need advice on how to structure a repository

Hello! I'm making a program that will interact with data in a json file, so I'm making a class to represent that. The methods that are going to be in the class are: * Register() — will create the json file if it doesn't already exist * Write() — will overwrite the contents of the file with new contents * Read() — will read the file and return the string json that it contains Any suggestions on this? My immediate concern is whether I should be deriving some interface or interfaces, rather than doing it raw like I'm intending to so far
3 Replies
Alisa
Alisa12mo ago
It may be helpful to have additional context, so here's a link to the project so far: https://github.com/Axlefublr/ChoreTracker/tree/rewrite I've seen this being done but I don't think it's in any way helpful: creating your own interface that contains all of those methods and then implementing a class deriving from it. Really unsure of how that would be a helpful thing
ffmpeg -i me -f null -
you could have this as complicated as you want, for example having a driver class for the json, a orm class, and then a repository but i would suggest to be as simple as it needs to be it or it will a project that will require an infinite amount of time the point is understanding how much simple, for example i imagine there is no multithreading and the data will have one shape and that's it if this project is for yourself, i'd say go raw, first make it work, then after you'll use it you'll see if you need more features and so extract interfaces and stuff; i can tell there could be a lot of features given the type of project, but i don't know if you have ideas about how do you want to evolve this if it's for school or something else it's different
Accord
Accord12mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.