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

feat: Added FoodRepositoryFacade #34

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

koreanMike513
Copy link
Collaborator

facade 계층을 하나 추가하여 락을 획득하는 RETRY 로직을 구현하였습니다.

그 후 테스트를 통해 정상적으로 동작하는 것을 확인하고 OrderService 내의 foodRepository 를 foodRepositoryFacade로 교체하였습니다.

- added FoodRepositoryFacade that handles RETRY logic on the food locks
@koreanMike513 koreanMike513 added the enhancement New feature or request label Jan 7, 2025
@koreanMike513 koreanMike513 self-assigned this Jan 7, 2025
@Slf4j
@Component
@RequiredArgsConstructor
public class FoodRepositoryFacade {

Choose a reason for hiding this comment

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

Facade 외에 AOP를 사용하여 재시도 구현시 장단점을 비교 해보는 것을 추천드립니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

우선 기존의 facade를 대신하여 AOP를 사용하면

장점

  • 확장성 (기존의 코드를 변경하지 않아도 된다. facade 패턴을 적용했을 때 OrderService의 의존성을 변경해주어야 하는 문제가 있었습니다)
  • 선언적 annotation으로 쉽게 선언 및 적용 가능

단점

  • 런타임에 동작하기 때문에 정확한 디버깅이 어려울 수 있다.
  • 각 annotation의 의미를 잘 알아야 하기 때문에 learning curve가 높을 수 있다.

정도로 생각되어집니다.

@koreanMike513 koreanMike513 added the partially_resolved (requires a another review) resolved the addressed issues requires a review label Jan 8, 2025
@koreanMike513 koreanMike513 merged commit f0bebbc into main Jan 9, 2025
1 check passed
@koreanMike513 koreanMike513 deleted the feature/add-food-facade branch January 9, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request partially_resolved (requires a another review) resolved the addressed issues requires a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants