Skip to content

김지훈 - 자판기 온보딩 프로젝트#9

Open
kigpand wants to merge 37 commits into
mainfrom
jihun
Open

김지훈 - 자판기 온보딩 프로젝트#9
kigpand wants to merge 37 commits into
mainfrom
jihun

Conversation

@kigpand
Copy link
Copy Markdown
Collaborator

@kigpand kigpand commented Nov 23, 2024

No description provided.

@kigpand kigpand added the WIP 아직 작업 중입니다 label Nov 23, 2024
@kigpand kigpand added Needs Review 리뷰받을 준비가 되면 추가해주세요 WIP 아직 작업 중입니다 and removed WIP 아직 작업 중입니다 Needs Review 리뷰받을 준비가 되면 추가해주세요 labels Nov 26, 2024
@kigpand kigpand added Needs Review 리뷰받을 준비가 되면 추가해주세요 and removed WIP 아직 작업 중입니다 labels Nov 27, 2024
@kigpand kigpand requested a review from taggon December 2, 2024 12:34
Comment thread src/components/Machine.js Outdated
export default class Machine {
constructor(version) {
this.version = version;
this.machine = document.createElement("article");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

article 엘리먼트를 사용한 이유가 있을까요? this.machine 이라는 이름은 적절한 이름일까요?
코드를 그대로 해석하면 Machine 내부에 machine이 있다는 의미로 보입니다.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

확인했습니다!

Comment thread src/components/Machine.js Outdated
this.machine = document.createElement("article");
this.machine.className = `machine ${version}`;

document.querySelector("body").appendChild(this.machine);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

document.body를 사용하지 않은 이유가 있을까요?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

생각하지 못했습니다!

Comment thread src/components/Machine.js
document.querySelector("body").appendChild(this.machine);
}

on() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

on은 어떤 의미를 담고 있는 이름일까요?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

머신이 실행된다는 의미로 메소드명을 지정했습니다

Comment thread src/components/input/InputField.js Outdated
behavior: "smooth",
});

inputText.innerText = (inputNum - value).toLocaleString();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

toLocaleString은 자주 반복되는데, formatNumber 등으로 래핑하는 편이 더 직관적이지 않을까요? 또한 어떤 통화 체계에서는 세자리마다 컴마를 찍는 동작이 일어나지 않을 수도 있는데, 고려하신 걸까요?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

생각하지 못했습니다. 다시 확인해보겠습니다

@@ -0,0 +1,9 @@
export default class InputFieldButton {
constructor(version, label, price) {
this.element = document.createElement("button");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이대로 동작은 하겠지만 element가 이 클래스의 프로퍼티라는 점을 명확히 하기 위해서 constructor 전에 선언해주면 좋을 것 같습니다.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

확인했습니다

@@ -0,0 +1,9 @@
export default class OutputFieldButton {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

클래스를 사용해 OOP를 의도하신 거라면 element라는 공통 프로퍼티를 가지는 여러 클래스에 대해서 공통된 부모 클래스를 가져갔어도 되지 않을까요?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

다시 생각해보겠습니다!

@kigpand kigpand added WIP 아직 작업 중입니다 and removed Needs Review 리뷰받을 준비가 되면 추가해주세요 labels Dec 3, 2024
outputTextArea = new OutputFieldTextArea(machine.element, version);
});

it("투입 테스트", () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"투입 테스트"보다 더 상세하게 기술해주세요. 예를 들면 "투입한 금액만큼 표시되는 금액이 증가한다" 같은 식으로 해도 좋습니다.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

넵 알겠습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP 아직 작업 중입니다

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants