Repository navigation
Coordinate Step6 complete - #125
Merged
Merged
Conversation
javajigi
suggested changes
Oct 27, 2018
| import java.util.Set; | ||
|
|
||
| public abstract class Figure { | ||
| public abstract class Figure extends FigureFactory implements FigureInformation { |
Contributor
There was a problem hiding this comment.
Figure가 FigureFactory를 상속하는 구조인데 괜찮은 설계인가?
Figure는 FigureFactory의 자식 특성을 그대로 가지고 있는 것이 맞나?
객체의 상속에 대해 다시 한번 생각해 보면 좋겠다.
| static { | ||
| figures.put(FigureType.LINE, points -> new Line(points)); | ||
| figures.put(FigureType.TRIANGLE, points -> new Triangle(points)); | ||
| figures.put(FigureType.RECTANGLE, points -> new Rectangle(points)); |
| public Line(List<Point> points) { | ||
| Line(List<Point> points) { | ||
| super(points); | ||
| checkSize(TWO); |
Contributor
There was a problem hiding this comment.
현재 각각의 Figure에서 checkSize(TWO), checkSize(THREE)와 같이 호출하고 있는데 이 부분의 중복도 없애 본다.
힌트는 FigureInformation 인터페이스에 size() 메소드를 추가하고 체크하는 로직을 Figure가 담당하도록 도전해 본다.
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.
Coordinate Step6 complete.
please give me a feedback.
thank you.