Skip to content

Coordinate step2 complete - #109

Merged
javajigi merged 4 commits into
code-squad:forevereverfrom
foreverever:step2
Oct 16, 2018
Merged

javajigi merged 4 commits into
code-squad:forevereverfrom
foreverever:step2

Conversation

@foreverever

Copy link
Copy Markdown

step2 complete
please give me the feedback
thank you

@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/MainCoordinate.java Outdated
Parcer parcer = new Parcer(getCoordinateValue());
PointList pl = new PointList(parcer.makePostion());
List<Point> pointList = pl.makePointList(); //pointList에 모든 point들을 담는다
Line line = new Line(pointList);

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 line = new Line(parcer.makePostion);
과 같이 바로 구현하는 것은 어떨까? PointList를 생성하고 List를 꺼내는 일이 왜 필요한가?

오타 신고 : parcer -> parser, makePostion -> makePosition

Comment thread src/main/java/util/Parcer.java Outdated

public List<Integer[]> makePostionList(String[] temp) {
List<Integer[]> pos = new ArrayList<>();
for (int i = 0; i < temp.length; i++) {

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.

foreach 구문으로 구현할 수 없을까?

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

public class Parcer {

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/util/Parcer.java Outdated
import java.util.ArrayList;
import java.util.List;

public class Parcer {

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.

외부에서 접근하지 않고 내부에서만 접근하는 메소드의 접근 제어자는 public 이 아니라 private으로 구현한다.

Comment thread src/main/java/domain/Line.java Outdated
this.p2 = pointList.get(1);
}

public double calcLength() {

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에서 구현하면 어떨까?
return p1.calcLength(p2);

@javajigi
javajigi merged commit 7318264 into code-squad:foreverever Oct 16, 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