Skip to content

Step3 - #129

Merged
javajigi merged 3 commits into
code-squad:daesoopfrom
daesoop:step3
Nov 13, 2018
Merged

Step3#129
javajigi merged 3 commits into
code-squad:daesoopfrom
daesoop:step3

Conversation

@daesoop

@daesoop daesoop commented Nov 13, 2018

Copy link
Copy Markdown

사실 완성한 것은 저번주에 완성했었지만, 방학이었기에 지금 올립니다.

처음 점이 2개 일때와 4개일 때를 어떻게 비교하면 좋을까 고민하다 Map에 있는 Hashmap을 사용하게 되다 상속을 사용하게 되었습니다. 그렇게 완성을 하고 간편히 삼각형도 만들게 되었습니다. 그러면서 중복된다고 생각한 코드는 없앤다고 없앴지만, 확인 부탁드립니다.

상속을 이런식으로 사용하는 것이 맞는지가 너무 궁금합니다.

@javajigi
javajigi changed the base branch from master to daesoop November 13, 2018 07:09

@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.

인터페이스 관련 피드백 남겼는데 아직 인터페이스 학습하지 않은지라 다음 단계에서 학습 후 적용해 본다.

this.points = points;
}

public AbstractFigures select(int size) {

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.

이와 같이 구현할 경우 매번 Map을 초기화하는 문제가 있다.
Map이 프로그램이 시작할 때 한번 초기화하고 재사용 가능한 구조로 구현해 본다.

힌트는 다음과 같은 인터페이스를 활용해야 한다.
인터페이스 학습 후 반영해 본다.

interface FigureCreator {
    Figure create(List<Point> points);
}

@javajigi
javajigi merged commit f7c6e57 into code-squad:daesoop Nov 13, 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