DEV Community

Discussion on: Do you have a process for naming things?

Collapse
 
leoat12 profile image
Leonardo Teteo

I generally make APIs, usually in a MVC set up, so it is relatively easy to name things. There are the entity classes and you name them under what they represent: Client, Order, Company, etc. Then, each one of them will have a service to implement the business logic for each one, so: ClientService, OrderService, etc. Then we have a controller for basically each one, then: ClientController, OrderController, etc. Methods are named under what they do, variables under they what store. Global things are generally things like authorization, database connection, configuration, etc. and they name themselves.
I don't have problems to name things and create a pattern for the names, generally it is very straightforward.