-
Notifications
You must be signed in to change notification settings - Fork 0
3_DI #2
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
base: main
Are you sure you want to change the base?
3_DI #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Укажи README с текстом ДЗ и своим ФИО, пожалуйста (либо пропиши в пояснении к pull request хотя бы ФИО)
|
|
||
| dependencies { | ||
| implementation("org.springframework.boot:spring-boot-starter") | ||
| implementation("org.projectlombok:lombok:1.18.30") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше будет указать в compileOnly и версию можно не указывать
|
|
||
| @Override | ||
| public void createTransaction() { | ||
| System.out.println("Create Withdraw Transaction"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ты ведь здесь же в классе логирование используешь, зачем System.out?)) Всегда используй логгер, вместо System.out
| import org.springframework.stereotype.Controller; | ||
|
|
||
| @Slf4j | ||
| @Controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему Controller? никаких web вызовов я не увидел
|
|
||
| @Slf4j | ||
| @Service | ||
| @Primary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
неудачное использование Primary, можно обойтись и без него (да и без Qualifire). Используй внедрение через имя поля (когда имя поля соответствует имени бина).
Как правило Qualifire это дурной тон, аннотация хоть и бывает полезной в определенных случаях (как и Primary) но в реальном мире ее стараются не использовать
| public void deposit() { | ||
| deposit.createTransaction(); | ||
| deposit.transaction(); | ||
| } | ||
|
|
||
| public void withdraw() { | ||
| withdraw.createTransaction(); | ||
| withdraw.transaction(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Методы не используются
Псевдосервис банковских транзакций.