Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why aren't the services static? #24

Closed
AshotN opened this issue May 10, 2020 · 6 comments
Closed

Why aren't the services static? #24

AshotN opened this issue May 10, 2020 · 6 comments

Comments

@AshotN
Copy link

AshotN commented May 10, 2020

Is there any reason that classes like userService aren't static?

Wouldn't it be easier to call the method without having to initiate an object?

@ljlm0402
Copy link
Owner

@AshotN

There is no particular reason. I think the way you speak is good. Thank you for your pull request.

@ragrag
Copy link

ragrag commented May 12, 2020

i think having non-static classes is much better out of the box for dependency injection of them and of other services/instances inside them without playing much around with IoC Containers

@AshotN
Copy link
Author

AshotN commented May 13, 2020

Feel free to close this issue if you believe that there is no need to change anything.

@ljlm0402
Copy link
Owner

@ragrag

Thank you very much for the comment.
If so, is that open source well organized? Sorry. I speak English with a translator incorrectly.

@ragrag
Copy link

ragrag commented May 13, 2020

@ljlm0402
I would consider it very organized however there are a couple of suggestions i would like to propose.

  1. Having a separate file responsible for bootstrapping the database connection/initialization. (and associations in case of sequelize)
    image

  2. Having a flag or an option in the CLI to structure the project by entities/components instead of technical roles as shown in the image:
    image
    Please see: https://github.com/goldbergyoni/nodebestpractices/blob/master/sections/projectstructre/breakintcomponents.md

@ljlm0402
Copy link
Owner

@ragrag

Thanks for the good suggestions and detailed explanations.
It was very helpful. We will try to reflect it after review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants