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

Инъекция зависимостей в класс #1

Open
GordPavel opened this issue Feb 25, 2022 · 0 comments
Open

Инъекция зависимостей в класс #1

GordPavel opened this issue Feb 25, 2022 · 0 comments

Comments

@GordPavel
Copy link

https://github.com/AlexMaxpower/ChoiceMarket/blob/2eabadc0f0ca452225082998ba1d2e288b423f9f/src/managers/ChoiceMarketManager.java#L21
Не нужно в самом методе каждый раз создавать новые объекты. Лучше перенести такие ссылки на другие менеджеры. поле класса и передавать их через конструктор. А в Main или в какой-то фабрике правильно создавать и связывать менеджеров

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

1 participant