Skip to content

Step2 push - #75

Merged
javajigi merged 8 commits into
code-squad:jar100from
jar100:step2
Oct 11, 2018
Merged

javajigi merged 8 commits into
code-squad:jar100from
jar100:step2

Conversation

@jar100

@jar100 jar100 commented Oct 8, 2018

Copy link
Copy Markdown

No description provided.

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

아직도 상태 데이터를 가지는 객체에서 데이터를 get하고 있네요.
사고의 전환을 통해 상태 데이터를 가지는 객체에 메시지를 보내도록 구현하는 연습을 하면 좋겠네요.


public class Calculator {

public static double line(ArrayList<Point> points) {

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가 구현하도록 개선해 보고 현재 코드와 비교해 본다.
어느 구현이 더 나은가?


public void disPlay(ArrayList<Point> points) {
for (Point point : points) {
field.get(point.getYPoint()).getCoordinateLine().get(point.getXPoint()).toStar();

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.

상태를 가지는 객체의 데이터를 꺼내려(get)하지 말고 객체에 메시지를 보내라는 원칙에 따라 구현한다.

@javajigi
javajigi merged commit 1fb3218 into code-squad:jar100 Oct 11, 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