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

[로또 게임] 김지웅 2차 과제 제출합니다. #18

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

wldnd7145
Copy link

No description provided.

@wldnd7145 wldnd7145 changed the title [로또 게임] 김지웅2차 과제 제출합니다. [로또 게임] 김지웅 2차 과제 제출합니다. Jul 18, 2024
Copy link
Collaborator

@genius00hwan genius00hwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

controller의 역할에 대해 좀더 생각해보고 mvc를 더 공부해보세요.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mvc에서 비즈니스 로직을 수행하는 역할은 controller가 합니다.


import java.util.List;

public class LottoResultChecker {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

객체라기보다는 함수를 실행시키는 역할만 하는 것으로 보이네요.

private final Console console = System.console();
private final Scanner scanner;

public LottoInput() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 무슨 의도죠? console은 주어진 요구사항입니다. 굳이 예외처리 하지 않아도 됩니다.

if (console != null) {
input = console.readLine();
} else {
input = scanner.nextLine();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굳이 왜 scanner 사용을 고집하는걸까요? 가독성이 떨어집니다.

import java.util.List;

public class Application {
public static void main(String[] args) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main 함수에 모든 흐름이 다적혀 있네요. controller는 단순히 실행시키는 역할을 하는 객체가 아닙니다.

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

Successfully merging this pull request may close these issues.

2 participants