edunota / edunota-guideline

MIT License
0 stars 0 forks source link

Suggest edunota backend naming convention with a template #11

Open KerimCETINBAS opened 9 months ago

KerimCETINBAS commented 9 months ago
[dirname]
template=
example=

[filename]
template=
example=

[interface]
template=
example=

[struct]
template=
example=

[constructor]
template=
example=

i do suggest

[dirname]
template=<name>_<type>
example=user_module, user_service

[filename]
template=<name>.<type>[_test].ext
example=user.controller.go user.controller_test.go price.calculator.helper.go

[interface]
template=I<SnakeCaseInterfaceName> 
example= IUserService IUserController IMockUserController ITSUserController 

[struct]
template=<camelCaseStructName> <SnakeCaseStructName>
example=UserDataStruct User user userDataStruct UserSerializer UserCreateDto
description= if a struct implements an interface it must be private and constructed by a func
[constructer]
template=New , <SnakeCaseConstructorName>
example= New, UserController
description= if module has only one constructer use New, 
or SnakeCaseName without any prefix, for a case,
 a struct implements IUserService constructer name should be UserService 
 or New if module doesn't have any other constructor

please suggest yours in comments