Skip to content

Step2 PR #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jan 28, 2019
Merged

Step2 PR #40

merged 14 commits into from
Jan 28, 2019

Conversation

lkhlkh23
Copy link

  1. list.html에 목록 보이는 부분 리플랙션을 활용해서 {{#user}} {{id}} 와 같이 mustache에서 읽을 수 있게 수정
  2. MethodType Enum을 추가
  3. Handler Argument Resolver 적용
  • Resolver를 이용해서 리플렉션을 활용해서 동적으로 객체를 생성하는 과정을 간소화하였지만, 아직 전체적으로
    코드가 지저분하고, 복잡하다고 생각이 듭니다. 추가적으로 게선해야할 부분이 무엇있을까요?!
  1. 개선필요점
  • 입출력에 관한 메소드 재정리 필요 --> 기존 구현된 메소드 활용이 필요
  • @GetMapping, @PostMapping 중복 제거 필요

Copy link
Contributor

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

리팩토링 잘 했네요. 💯
추가 개선을 위한 피드백 남겨 봅니다.

return true;
}

return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

return matcher.find();로 구현 가능

Copy link
Author

Choose a reason for hiding this comment

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

피드백 반영

@@ -74,7 +75,7 @@ public static void registerGetMethod(Class clazz, Stream<Method> stream) {
List<Method> getMethods = stream.collect(Collectors.toList());
for (Method getMethod : getMethods) {
GetMapping getMapping = getMethod.getAnnotation(GetMapping.class);
handlerMapper.put(new Mapping(getMapping.value(), "GET")
handlerMapper.put(new Mapping(getMapping.value(), MethodType.GET)
, (body, jSessionId) -> invokeMethod(createAllParameters(body, getMethod, jSessionId), clazz, getMethod));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

GET과 POST mapping하는 부분을 분리해야 하나?
분리하지 않고 구현할 수 없나?

Copy link
Author

Choose a reason for hiding this comment

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

Enum, Lambda를 이용해서 구현했습니다. 피드백 부탁드립니다!
피드백 반영

}

@Override
public Class identification() {
Copy link
Contributor

Choose a reason for hiding this comment

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

supportsParameter 메소드를 활용하면 굳이 이 메소드가 필요한가?

Copy link
Author

Choose a reason for hiding this comment

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

기존의 identification() 메소드가 supportParameter 와 동일한 역할을 수행하기 때문에 identification() 제거 및 supportParameter() 활용하도로 수정


public class WebMvcConfig {

private Map<Class, HandlerMethodArgumentResolver> handlerMethodArgumentResolvers;
Copy link
Contributor

Choose a reason for hiding this comment

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

List<HandlerMethodArgumentResolver> handlerMethodArgumentResolvers로 구현할 수 있지 않을까?

Copy link
Author

Choose a reason for hiding this comment

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

List 구현 완료

  • 질문사항 : Map으로 key 값을 통해 접근하는 것이 List 에서 하나씩 조회하는 것보다 빠르다고 생각을 해서
    Map으로 구현을 했는데, 리스트로 구현을 해야하는 이유는 무엇이 있을까요?!

@javajigi javajigi merged commit 3219616 into code-squad:lkhlkh23 Jan 28, 2019
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