Skip to content

coordinate step 2 완료했습니다. - #126

Merged
javajigi merged 3 commits into
code-squad:daesoopfrom
daesoop:step2
Oct 30, 2018
Merged

javajigi merged 3 commits into
code-squad:daesoopfrom
daesoop:step2

Conversation

@daesoop

@daesoop daesoop commented Oct 29, 2018

Copy link
Copy Markdown

이번 step 2를 하는 도중 진전이 없어 다시 처음부터 공부하고 다른 사람들의 사다리게임 코드를 보았었습니다. 다른 사람들의 코드를 읽는 것이 많이 도움이 된 것 같습니다. 물론 어렵고 적용하기는 힘들지만, 확실히 다른사람들 코드를 보니 깨달은 것들이 많았습니다.
이번 저의 코드에서는 포인트 클래스에서 get메소드를 사용하여 x와 y의 arraylist를 만들어 값들을 가져왔습니다. 하지만 다른 방법을 생각하는 도중 포인트 클래스에서 생성자를 이용하여 값들을 가져와 새로 만들 수 있다는 생각도 하게 되었습니다. 하지만 그렇게 만드는 것이 쉽지 않아 일단....

그리고 예외처리를 저번 시간에 배웠었는데, 제대로 이해가 되지 않아 공부를 더하고 옆 사람들에게 물어 예외처리를 적용하였는데, 아직 미숙하고 제대로 이해하지 못한 것 같습니다. 특히 메인 메소드에서 try, catch문을 사용하는 것이 영 찝찝합니다.

이번 step은 혼자서 설계하고 도움을 한번도 받지 않았습니다. 그래서 더욱 시간이 많이 걸리고 힘이 빠지던 순간이었던 것 같습니다. 저번 보다 모든 부분이 많이 부족하다 느껴지실듯 합니다.

@javajigi javajigi left a comment

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.

피드백 남겼어요.

Comment thread src/main/java/model/MakePoint.java Outdated

public class Point {

// 인스턴스가 많아도 너무 많다.... 이걸 줄여야 되는데

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.

내가 남기려고 한 피드백을 남겼네

Comment thread src/main/java/model/Parser.java Outdated
import java.util.ArrayList;
import java.util.List;

public class ParserString {

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.

굳이 인스턴스 변수와 메소드로 구현하지 말고 클래스 메소드로 구현해 본다.

Comment thread src/main/java/model/MakePoint.java Outdated
}
return false;
}
}

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.

Point는 사용자가 입력한 값에 대해서만 인스턴스를 만들고 나머지는 위치 정보는 Point 인스턴스 생성하지 않고 구현할 수는 없을까?

@javajigi javajigi left a comment

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.

피드백 남겼어요.

Comment thread src/main/java/model/MakeLine.java Outdated
public class MakeLine {

private Point aPoints;
private Point bPoints;

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.

Line에 두 값이 저장해서 반환했는데 굳이 이 2개의 Point를 인스턴스 변수로 가지는 이유가 있나?
2개의 인스턴스 변수를 제거한다.

Comment thread src/main/java/model/MakeLine.java Outdated
private Point aPoints;
private Point bPoints;

public Line makeLine(String coordinate) throws Exception {

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.

클래스 메소드로 구현한다.

Comment thread src/main/java/view/PrintView.java Outdated
printCoordinate();
System.out.println(String.valueOf(stringBuilder));

public void printAll(Line line, MakeLine parser) {

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.

인자로 Line만 전달해 구현한다.

Comment thread src/main/java/view/PrintView.java Outdated
Point b = parser.getbPoints();
printCoordinate(a, b);
printDistance(line.lineDistance());
System.out.println(String.valueOf(coordinatePrint));

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.

String.valueOf 대신 coordinatePrint.toString()으로 구현한다.

}

private static void diffrentYBar(Point a, Point b) {
if (a.getY() != b.getY()) {

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.

a.matchY(b)와 같이 구현해 본다.

@javajigi
javajigi merged commit 5e5f619 into code-squad:daesoop Oct 30, 2018
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