Class Naming Conventions
I'm currently renaming all the classes in my Discord Bot project but I'm stumped to decide what the suffix should be for a class that the wrapper for a collection in a database.
Context
wouldn't make sense, since I am not using Entity Framework.
Currently I have;
- Services
for classes that just do things (like handling guild logging events)
- Modules
for the interaction modules that are used by Discord.NET (handling slash commands)
- Models
Whatever is the type for the collection
- Controller
ASP.NET controllers, duh.6 Replies
If — for whatever godforsaken reason — you're not using EF, you are hereby permitted to use repositories
i'm only not using EF because I prefer having as much control over my data and schemas in my database (and when I started this project, I had no idea how to use it with MongoDB)
Ah oof ouch Mongo
Sure, just use the Mongo driver here
Yeah I am
I'm not that insane lol
Repository
floats around but that's usually associated with the pattern of the same name or just like MongoService
🤷♂️
There are only 2 hard problems in computer science 1. Naming things 2. Cache Invalidation 3. Off by one errorsTbh i have used
Context
even if just using dapper or w/e b/c context == database in my mind 😛Repository
sounds good and there are no words used in the suffix that other classes use, so I'll probaby use that
But it's only one collection per-class (hence why I wouldn't do Context
)