Skip to content
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

[톰캣 구현하기 - 3, 4단계] 오잉(이하늘) 미션 제출합니다. #428

Merged
merged 16 commits into from
Sep 12, 2023

Conversation

hanueleee
Copy link

@hanueleee hanueleee commented Sep 9, 2023

안녕하세요 하디 🕺
이번 미션 3,4단계 완료했습니다!

3단계(리팩토링)를 진행하다보니 수정사항이 꽤 많이 생겼습니다 ㅎㅎ..

  1. Servlet
    기존 Servlet의 handle메소드는 Request를 파라미터로 받아 적절한 Response를 반환했습니다.
    수정 후 Servlet의 service메소드가 Request, Response를 모두 파라미터로 받고,
    service 로직 속에서 response에 적절한 값을 세팅해주게 되었습니다.

  2. MethodNotAllowedException & BadRequestException
    허용하지 않는 메소드이거나 잘못된 요청인 경우 error를 발생시키고
    Http11Processor에서 해당 error를 잡아 적절한 response를 세팅하도록 수정했습니다.

  3. HttpHeaders -> RequestHeaders & ResponseHeaders
    HttpRequest, HttpResponse 모두에서 사용되던 HttpHeaders를 RequestHeaders와 ResponseHeaders로 분리했습니다.

이번 리뷰도 잘 부탁드립니다!! 🙇‍♀️

@hanueleee hanueleee self-assigned this Sep 9, 2023
@hanueleee hanueleee changed the title [톰캣 구현하기 - 3,4단계] 오잉(이하늘) 미션 제출합니다. [톰캣 구현하기 - 3, 4단계] 오잉(이하늘) 미션 제출합니다. Sep 9, 2023
Copy link

@jundonghyuk jundonghyuk left a comment

Choose a reason for hiding this comment

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

오잉 코드 잘봤어요 ㅎㅎ

너무 멋집니다.

Response를 외부에서 생성하고 넣어주는 것 외에는 커다란 흐름의 변경은 없는 것 같아요 !

개별적으로 커멘트 달아놨습니다 ㅎㅎ

다음번에 요청주시면 바로 머지해도될것같아요 고생하셨어요 ~!

@hanueleee
Copy link
Author

안녕하세요 하디!

주요 변경지점은 다음과 같습니다.

  1. Http11Processor에 있던 에러 핸들링 로직을 Servlet안으로 이동
  2. 각 Servlet별 allowedMethods 지정

그런데 뭔가..? Servlet 내부 코드가 좀 그렇네요..
추상클래스를 잘 안써봐서 그런건지.. 각 메소드별로 접근제어자가 중구난방인 느낌?!

그리고 servlet별로 다른 allowedMethod를 어떻게 상위클래스로 넘길 수 있을지 고민하다가, 생성자에서 super로 넘겨서 세팅하는 방식을 택했는데 혹시 어떻게 생각하시나요?!

Copy link

@jundonghyuk jundonghyuk left a comment

Choose a reason for hiding this comment

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

오잉 고생하셨어요 !

리뷰 반영해주신거 확인했습니다 !

오잉 코드보고 많이 배워갑니다 ~~!

머지하겠습니다 ㅎㅎ

얼마전 크루에게 들은 내용인데 패키지간 의존성도 마지막으로 한 번 분석해보면 좋을 것 같아요 !

다음 미션도 화이팅 하십쇼 !!👍

@jundonghyuk jundonghyuk merged commit a14b7af into woowacourse:hanueleee Sep 12, 2023
1 check passed
@sonarcloud
Copy link

sonarcloud bot commented Sep 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

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