Repository navigation
submit step5 1st - #116
Merged
Merged
submit step5 1st#116
Conversation
javajigi
suggested changes
Oct 16, 2018
| map.put(2, new Line(points)); | ||
| map.put(3, new Triangle(points)); | ||
| map.put(4, new Rectangle(points)); | ||
| return map.get(points.size()).toString(); |
Contributor
There was a problem hiding this comment.
이렇게 되면 points 크기가 2인 경우에도 모든 도형을 생성하지 않을까요?
성능 이슈도 있고, 뭔가 맞는 구조는 아니라는 생각이 드네요.
예를 들어 다음과 같은 인터페이스를 만들고 이에 대한 각각의 구현체를 Figure 구현체에서 생성하도록 한다면..
public interface FigureMessage {
String outputMessage();
}
|
|
||
| public List<Point> getPoints() { | ||
| return points; | ||
| } |
Contributor
There was a problem hiding this comment.
이와 같이 전체 데이터를 공개하기 보다 다음과 같은 메소드면 충분하지 않을까?
protected Point getPoint(int index) {
return points.get(index);
}
접근 제어자도 꼭 필요한 범위로 한정하도록 한다.
javajigi
approved these changes
Oct 18, 2018
javajigi
left a comment
Contributor
There was a problem hiding this comment.
Factory 인터페이스 추가 및 테스트 코드 구현 잘 했네요. 💯
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
지저분한거 다시 만들었습니다.