Repository navigation
Step5 - #113
Merged
Merged
Step5#113
Conversation
javajigi
suggested changes
Oct 16, 2018
| protected String name; | ||
| protected ArrayList<Point> points; | ||
| protected int size; | ||
| protected double result; |
Contributor
There was a problem hiding this comment.
Figure의 모든 인스턴스 변수를 private으로 구현한다.
| public abstract class Figure { | ||
| protected String name; | ||
| protected ArrayList<Point> points; | ||
| protected int size; |
Contributor
There was a problem hiding this comment.
name과 size의 경우 인스턴스 변수 대신 추상 메소드로 구현해 본다.
| toDo.put(T, new Triangle(points).calculate()); | ||
| toDo.put(TWO, new Line(points).area()); | ||
| toDo.put(FOUR, new Rectangle(points).area()); | ||
| toDo.put(T, new Triangle(points).area()); |
Contributor
There was a problem hiding this comment.
이와 같이 구현하면 사용자가 값을 입력할 때마다 Map을 생성해야 하기 때문에 성능이 떨어질 것 같다.
매번 Map을 생성하지 않도록 구현할 수는 없을까?
다음과 같은 힌트를 준다면 도움이 좀 될까요?
public interface FigureCreator {
Figure create(List<Point> points);
}
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.
step5 pr 보냅니다 피드백 부탁드려요