Skip to content

[24기_문수연] spring tutorial 미션 제출합니다. - #10

Open
uoahns23 wants to merge 3 commits into
CEOS-Developers:masterfrom
uoahns23:tutorial323
Open

[24기_문수연] spring tutorial 미션 제출합니다.#10
uoahns23 wants to merge 3 commits into
CEOS-Developers:masterfrom
uoahns23:tutorial323

Conversation

@uoahns23

@uoahns23 uoahns23 commented Sep 9, 2026

Copy link
Copy Markdown

CEOS 백엔드 1주차 미션 제출합니다~!

@fervovita fervovita left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

리드미가 잘 작성되어 있어서 저도 읽으면서 좋은 공부가 된 것 같습니다 👍👍

1주차 과제 수고 많으셨습니다~!

Comment thread README.md

---

## BeanPostProcessor

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

BeanPostProcessor로 인해 만들어지는 Proxy가 어떤 방식으로 만들어지는지 조사해보셔도 좋을 것 같습니다!
(JDK Dynamic Proxy, CGLIB)

각각 언제 선택되고 어떻게 생성되는지, 그리고 이 구조 때문에 생기는 제약에는 뭐가 있는지까지 보시면 좋을 것 같아요!

Comment thread README.md
Comment on lines +2897 to +2909
HTTP Request
DispatcherServlet
doDispatch()
HandlerMapping
HandlerAdapter
Controller
응답 처리

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

doDispatch() 흐름을 HandlerMapping -> HandlerAdapter -> HttpMessageConverter 기준으로 잘 정리해 주셨는데, 앞에서 예시로 드신 return "post"; 같은 @Controller도 이 흐름을 그대로 탈까요?

ModelAndViewViewResolver가 어디에 등장하는지 함께 보시면, @Controller@RestController의 처리 경로 차이가 잘 보일 것 같습니다!

Comment thread src/main/resources/application.yaml Outdated
@@ -0,0 +1,18 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/test_db?allowPublicKeyRetrieval=true&useSSL=false&characterEncoding=UTF-8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

지금은 과제라 괜찮지만, application.yaml은 추후 프로젝트에서 환경 설정에 중요하게 쓰일 파일인데 DB URL이나 비밀번호가 그대로 노출되면 문제가 될 수 있습니다.

따라서, 중요한 값들은 .env에서 별도로 관리해서 환경변수를 주입받거나, 프로필별 설정 파일을 분리해서 .gitignore에 등록하는 방식을 추천드립니다!

추가로, 이미 올라간 경우에는 해당 파일을 지우고 커밋해도 이전 히스토리에는 그대로 남아 있어서, 대응 방법도 함께 알아두시면 좋을 것 같아용!
https://docs.github.com/ko/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository

Comment thread README.md
Comment on lines +137 to +151
```java
@Service
public class OrderService {

private final PaymentService paymentService;

public OrderService(PaymentService paymentService) {
this.paymentService = paymentService;
}
}
```

`OrderService`는 구체적인 `CashPaymentService`에 직접 의존하지 않고 `PaymentService` 인터페이스에 의존한다.

따라서 구현체가 변경되어도 `OrderService`의 수정은 최소화할 수 있다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

인터페이스와 연관지어 DI를 사용하는 이유에 대해 설명하여 DI의 장점이 쉽게 이해됐습니다!

Comment thread README.md
Comment on lines +199 to +207
#### 3. 테스트가 쉽다.

Spring Container 없이도 직접 객체를 생성할 수 있다.

```java
UserRepository repository = new FakeUserRepository();

UserService userService = new UserService(repository);
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

예시 코드를 포함하여 생성자 주입의 장점을 테스트 코드와 연관 지어 설명한 점이 좋았습니다!

Comment thread README.md

---

## @PostConstruct / @PreDestroy

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

빈 초기화/소멸 콜백 시 어노테이션 방식 외에 존재하는 다른 방식들의 특징들도 한 번 알아보면 좋을 것 같습니다!
관련 블로그 글 하나 첨부하겠습니다!
https://velog.io/@suk13574/spring-%EB%B9%88-%EC%B4%88%EA%B8%B0%ED%99%94-%EC%BD%9C%EB%B0%B1-%EC%86%8C%EB%A9%B8-%EC%BD%9C%EB%B0%B1

Comment thread README.md

---

## 구현체를 모두 주입받을 수도 있다

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ListMap 방식을 관련 코드와 절차를 포함하여 설명해 쉽게 이해됐습니다! Map 방식에서 Bean 이름을 Key로 사용할 수 있다는 점도 잘 알아갑니다~~!

Comment thread README.md
Comment on lines +2382 to +2395
따라서 요청마다 변경되는 값은

```java
String username =
request.getParameter("username");
```

처럼 **지역 변수로 사용하는 것이 안전하다.**

이 부분은 앞에서 공부한

> Singleton Bean은 Stateless하게 설계해야 한다.

라는 내용과도 연결된다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

빈 스코프와 연관지어 Servlet 필드를 구성할 때 지역 변수를 사용해야 된다고 설명한 점이 좋았습니다!

Comment thread README.md

## 전체 학습 내용 연결하기

지금까지 공부한 Spring 개념을 하나의 요청 흐름으로 연결하면 다음과 같다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

전체 학습 내용의 흐름을 한 눈에 확인할 수 있게 정리해줘 다시 한 번 관련 내용 복습할 수 있었습니다. 감사합니다~!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

저도 마지막에 정리해주신 부분이 도움이 됐습니다. 하나의 요청 처리 흐름으로 연결해주신 부분이 좋았습니다!

@taiho0303-blip taiho0303-blip left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

내용을 자세하게 잘 정리해주셔서 읽으면서 다시 공부가 된 것 같습니다 👍

Comment thread README.md

## BeanPostProcessor

Bean Lifecycle을 공부하면서 이전에 공부한 **Proxy**와도 연결되는 부분이 있었다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

BeanPostProcessor를 Proxy와 Transactional까지 연결해서 설명해주신 부분이 특히 도움이 됐습니다! 실제 스프링 기능에서 BeanPostProcessor이 왜 필요한지 이해가 됐어요!

Comment thread README.md

## 전체 학습 내용 연결하기

지금까지 공부한 Spring 개념을 하나의 요청 흐름으로 연결하면 다음과 같다.

Copy link
Copy Markdown

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.

4 participants