Skip to content

Step2#410

Open
viva-zero wants to merge 13 commits intonext-step:viva-jayfrom
viva-zero:step2
Open

Step2#410
viva-zero wants to merge 13 commits intonext-step:viva-jayfrom
viva-zero:step2

Conversation

@viva-zero
Copy link

안녕하세요. 리뷰 부탁드립니다.

오랜만에 리뷰요청 드리는 것이라서 세션 구현까지 같이 진행해 보았습니다.

Copy link
Collaborator

@javajigi javajigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WAS 2, 3, 4단계를 한번에 구현했네요. 👍
전체적인 객체 구조에 대해서는 특별히 피드백할 내용은 없는데요.
특정 클래스에 인스턴스 변수가 너무 많아 피드백 남겼어요.
이 객체를 더 작은 단위의 객체로 분리해 보면 좋겠어요.

private Map<String, Object> attributes;
private Map<String, Cookie> cookies;
private HttpVersion httpVersion;
private ByteBuffer inputChannel;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인스턴스 변수의 수가 너무 많다.
관련있는 인스턴스 변수를 묶어 새로운 객체로 분리하는 것은 어떨까?
인스턴스 변수의 수는 가능한 적은 수를 유지할 것을 추천

.entrySet()
.stream()
.collect(Collectors.toMap(Map.Entry::getKey, entry -> new Cookie(entry.getKey(), entry.getValue())));
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인스턴스 변수의 수가 많다보니 이 객체가 하는 일이 너무 많다.
이 객체가 하는 일을 여러 객체로 분리해 보면 어떨까?

Comment on lines +15 to +16
private MultiValueMap<String, String> headers;
private final List<Cookie> cookies = new ArrayList<>();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일급 콜렉션을 적용해 보고 일급 콜렉션으로 구현하는 의미를 파악해 본다.

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