Skip to content

[23기_오지송] spring tutorial 미션 제출합니다.#5

Open
Oh-Jisong wants to merge 1 commit intoCEOS-Developers:Oh-Jisongfrom
Oh-Jisong:Oh-Jisong
Open

[23기_오지송] spring tutorial 미션 제출합니다.#5
Oh-Jisong wants to merge 1 commit intoCEOS-Developers:Oh-Jisongfrom
Oh-Jisong:Oh-Jisong

Conversation

@Oh-Jisong
Copy link

CEOS 백엔드 23기 오지송 : spring tutorial 미션 제출합니다.

Copy link
Member

@Hoyoung027 Hoyoung027 left a comment

Choose a reason for hiding this comment

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

1주차 과제 하시느라 수고 많으셨습니다!
과제 수행 과정과 개념 조사 내용도 상세하게 적어주셔서 좋았습니다

특히 리드미에 '좀 더 고민할 지점'이나 '아쉬웠던 점 및 계획'을 넣어주신 것도 인상적이었는데, 이런 내용을 질문주시거나 혹은 스터디에서 대화를 통해 얻어가셔도 좋을 것 같습니다 💪💪💪

Comment on lines +1 to +18
spring:
datasource:
url: jdbc:mysql://localhost:3306/test_db?allowPublicKeyRetrieval=true&useSSL=false&characterEncoding=UTF-8
username: root
password: 2562
driver-class-name: com.mysql.cj.jdbc.Driver

jpa:
hibernate:
ddl-auto: create
show-sql: true
properties:
hibernate:
format_sql: true

logging:
level:
org.hibernate.SQL: debug No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

p1. application.yml 파일은 환경 설정 관련해서 중요하게 사용될 파일일텐데요, 지금처럼 비밀번호가 공개되면 문제가 될 수 있습니다! (물론 지금은 로컬 DB이고 정식 서비스가 아니라서 큰 문제는 아니지만요 ㅎㅎ)

이런 상황을 방지 하기 위해서 중요한 값들은 .env에서 별도로 관리하기를 추천드리고 만약 업로드하면 안되는 자료를 깃허브에 업로드 했다면 어떻게 대응해야할지도 고민해보시면 좋을 것 같습니다!


### 6. 더 고민해보고 싶은 것
- 조금 더 디테일하게 들어가서
- 영화 장르, 쿠폰... 같은 것도 할 수 있을 듯 ... 에효
Copy link
Member

Choose a reason for hiding this comment

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

추후 과제로 수행하시겠지만, CGV 웹사이트에 들어가셔서 각 화면을 만들어내기 위해 DB에 저장되어야 할 것들은 무엇이 있을지 고민하시면 도움이 될 것 같아요!

SCREENING ||--o{ BOOKING : booked_for
THEATER ||--o{ THEATER_STORE_STOCK : manages
STORE_MENU ||--o{ THEATER_STORE_STOCK : stocked_as
```
Copy link
Member

Choose a reason for hiding this comment

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

ERD를 이렇게 넣을 수 있는지는 몰랐네요! 하나 배워갑니당

- Python 기반으로 FastAPI를 사용한 백엔드 개발을 주로 경험하다 보니
- Spring의 구조와 개념을 한 번에 이해하기는 쉽지 않았음...

- 웹 요청이 DispatcherServlet을 중심으로 처리되는 흐름은 코드만 보고 바로 이해하기에는 아직 부족함..
Copy link
Member

Choose a reason for hiding this comment

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

DispatcherServlet의 동작을 이해하기에 괜찮은 문서를 하나 공유드립니다. 이걸 보신 후에 코드를 살피시면 더 이해가 빠를 것 같아요 👍

https://mangkyu.tistory.com/18

그리고 제 개인 경험상 스프링을 이해하기 위해 reauest를 받았을 때, Filter, Interceptor, DispatcherServlet의 동작 흐름을 공부했었고 도움이 많이 되었던 것 같아요. 한번 참고하셔서 공부해보시면 좋을 것 같습니다!

Comment on lines +164 to +165
**2-3. 결과 확인**
![rslt](image/rslt.png)

Choose a reason for hiding this comment

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

스프링 튜토리얼 정리를 엄청 깔끔하게 하셨네요..!
결과 확인 스크린샷까지 정리되어 있어서 저도 이렇게 정리해둘 걸 싶었습니다

Comment on lines +406 to +443
- 각 의존성 역할 정리

1. spring-boot-starter-webmvc
- 웹 애플리케이션 개발용
- 포함 기능
- Spring MVC, REST API, DispatcherServlet, 내장 Tomcat 서버
- *Controller + REST API 만들 때 필수*

2. spring-boot-starter-webmvc-test
- Spring MVC 테스트용
- 주요 기능
- MockMvc
- Controller 테스트

3. junit-platform-launcher
- JUnit 테스트 실행을 위한 플랫폼 런처
- 테스트 실행 환경을 제공

4. Lombok
- 코드 자동 생성 라이브러리

5. spring-boot-starter-data-jpa
- Spring에서 DB 접근을 쉽게 하는 라이브러리
- 주요 기능
- Entity
- Repository
- Hibernate ORM
- JPQL
- *Java 객체 ↔ DB 테이블* 매핑

6. mysql-connector-j
- MySQL 데이터베이스 연결 드라이버
- Spring Boot가 MySQL 서버와 통신할 수 있게 함

7. spring-boot-starter-test
- Spring Boot 테스트 통합 패키지
- *Spring 테스트 기본 패키지*

Copy link

@gitaehee gitaehee Mar 15, 2026

Choose a reason for hiding this comment

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

저는 튜토리얼 잘 돌아가는지 확인 정도만 했는데
의존성 역할 정리까지 해주셔서 잘 읽고 갑니다

Copy link

@fervovita fervovita left a comment

Choose a reason for hiding this comment

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

과제하느라 수고 많으셨습니다.
자세한 사진과 예시 코드를 함께 넣어주셔서 쉽게 이해할 수 있었습니다😄

3. 의존성 주입 (DI)
4. 초기화 메서드 실행
5. 애플리케이션에서 사용
6. 컨테이너 종료 시 Bean 소멸

Choose a reason for hiding this comment

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

밑의 예시에서 보여주신 것처럼 컨테이너 종료 직전에 소멸 메서드가 실행됩니다.
Bean 라이프사이클 단계에서 5번 단계 뒤에 소멸전 콜백(?)과 같이 추가해 주는 방법도 좋을 것 같습니다!

---
> **🟡 좀 더 고민하기**

### 8. Interface 구현체가 여러 개 있을 때 주입 방법

Choose a reason for hiding this comment

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

인터페이스 구현체가 여러 개일 때의 대응 방안을 잘 정리해주셨네요! List로 모든 의존관계를 주입받는 방식도 새롭게 배우고 갑니다. 👍

말씀하신 @primary나 List 주입 외에도 @Qualifier를 사용하는 방법도 함께 언급되면 좋을 것 같습니다.

특정 빈을 명시적으로 지정해서 주입받고 싶을 때 @Qualifier("빈이름")을 사용하면 코드 가독성도 높아지고 의존성 관계가 더 명확해집니다.

> **🟡 좀 더 고민하기**
> *[https://mangkyu.tistory.com/216](https://mangkyu.tistory.com/216)*

### 5. DispatcherServlet 동작 흐름 분석

Choose a reason for hiding this comment

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

Dispatcher Servlet의 동작 흐름을 단계별로 자세히 분석해주셔서 저도 전체적인 흐름을 다시 한번 명확하게 정리하고 이해할 수 있었습니다.
좋은 정리 감사합니다!👍

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.

4 participants