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

[Lee] Step 3: HTTP 웹서버 구현 #4

Open
wants to merge 3 commits into
base: street62
Choose a base branch
from

Conversation

street62
Copy link
Collaborator

@street62 street62 commented Jul 23, 2022

Description

웹 서버 구현 PR입니다.

Commits

  • Request와 Response를 클래스로 추상화했습니다.
  • uri마다 별도의 비즈니스로직을 처리할 수 있도록 ResponseMaker 클래스를 분리했습니다.
  • ResponseMaker 클래스에서는 특정 uri에 해당하는 LogicExcutor 구현체를 가지고 있도록 해서, 각 LogicExcutor의 run() 메서드를 통해
    특정 비즈니스로직을 수행하고, 별도의 비즈니스 로직이 없을 경우에는 webapp 경로에서 해당하는 파일을 응답하도록 설계했습니다.

TODO

  • Request 쿼리 파싱하는 부분에서 버그가 있어서 수정할 예정입니다.
  • Response status code에 맞춘 응답 헤더를 세분화해야 이후 구현사항(302일 시 리다이렉트)을 구현하기 용이할 것 같아서 구조를 고민하는 중입니다.

구현을 늦게 시작했더니 구현량이 많지 않네요 ㅠㅠ
코쿼 과정 때에는 정신없이 했던 것 같은데, 객체지향적인 구조를 생각하다 보면 꽤 고려할 게 많은 미션이라는 생각이 들었습니다.
반성하고... 다음 회차부터는 매일 조금씩 꾸준히 진행해 보려고 합니다!

street62 added 3 commits July 23, 2022 14:38
Request, Response 객체를 분리하여 코드 추상화
ResponseMaker 클래스를 통해 uri에 맞는 세부 비즈니스로직을 적용할 수 있도록 함.
@street62 street62 changed the title 1회차 웹서버 PR: ~요구사항 3 [Lee] Step 3: HTTP 웹서버 구현 Jul 23, 2022
@donggi-lee-bit
Copy link
Member

Lee 하이용 재밌게 해보아용

Copy link
Member

@ku-kim ku-kim left a comment

Choose a reason for hiding this comment

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

Step 4도 화이팅이에요 lee~~

Comment on lines +31 to +37
dos = new DataOutputStream(out);
br = new BufferedReader(new InputStreamReader(in));
Request request = readRequest();
Response response = makeResponseOf(request);

sendResponse(response);
br.close();
Copy link
Member

Choose a reason for hiding this comment

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

메서드 단위로 로직을 구분하셨군요.!

donggi-lee-bit added a commit that referenced this pull request Aug 2, 2022
add() 메서드가 가진 여러 역할 리팩토링
jinan159 added a commit that referenced this pull request Aug 7, 2022
3장 요구사항 4 - 302 status code 적용
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.

3 participants