Skip to content

[24기_정태호] spring tutorial 미션 제출합니다. - #7

Open
taiho0303-blip wants to merge 3 commits into
CEOS-Developers:taiho0303-blipfrom
taiho0303-blip:taiho0303-blip
Open

[24기_정태호] spring tutorial 미션 제출합니다.#7
taiho0303-blip wants to merge 3 commits into
CEOS-Developers:taiho0303-blipfrom
taiho0303-blip:taiho0303-blip

Conversation

@taiho0303-blip

Copy link
Copy Markdown

No description provided.

@gilbert09031 gilbert09031 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
공통 로직 후처리
```

예를 들어 `@Transactional`이 붙은 메서드는 Proxy가 먼저 트랜잭션을 시작하고, 실제 메서드를 실행한 뒤 성공하면 Commit, 예외가 발생하면 Rollback한다.

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://hyperconnect.github.io/2025/02/10/spring-transactional-rollback.html
https://cheese10yun.github.io/checked-exception/
https://mangkyu.tistory.com/152

@Transactional은 모든 예외에 대해서 롤백을 보장할까요 ?
커스텀 예외를 작성할 때 왜 일반적으로 Exception이 아닌 RuntimeException을 상속받는지도 함께 고민해보면 좋을 것 같아요 !

Comment on lines +7 to +8
@Data
@Entity

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@rinarina0429 rinarina0429 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
- **Pointcut**: 실제로 AOP를 적용할 대상을 선택하는 조건
- **Advice**: 실제로 실행되는 공통 로직

#### Spring AOP 동작 원리

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spring AOP가 Proxy 방식으로 동작하는 과정을 깔끔하게 정리해주셨네요! @transactional 예시까지 있어서 이해하기 좋았습니다. 그렇다면 같은 클래스 내부에서 @transactional이 붙은 메서드를 직접 호출하면 트랜잭션이 정상적으로 적용될까요? Spring AOP의 Proxy 방식과 연결해서 알아보시면 좋을 것 같습니다!

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.

여러 요청이 하나의 Bean을 공유한다는 점에서, 만약 Singleton Bean의 필드에 사용자별 데이터를 저장한다면 동시에 여러 요청이 들어왔을 때 어떤 문제가 발생할 수 있을까요?

Comment thread README.md
- Servlet 생명주기 관리
- Session 관리

#### 전체 웹 요청 처리 흐름

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spring MVC의 요청 처리 흐름을 DispatcherServlet부터 HandlerMapping, HandlerAdapter까지 순서대로 잘 정리해주셨네요! 👍👍

@alissa159 alissa159 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
Comment on lines +145 to +148
public int order(String name, int price){
sout(...);
return price; // 지역변수로 처리
}

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
Comment on lines +347 to +350
@Bean(initMethod = "init", destroyMethod = "close")
public NetworkClient networkClient(){
...
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

초기화/소멸 메서드를 지정하는 방법을 @bean 속성 방식과 @PostConstruct/@PreDestroy 어노테이션 방식 두 가지로 나눠서 비교해주신 게 좋았습니다! destroyMethod의 기본값이 close, shutdown으로 자동 추론된다는 부분을 알게 되었네용

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