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

[BE/feat] 식사 분석하는 API 기능 변경에 따른 유스케이스 개발 및 기존 도메인 리팩토링 #379

Merged
merged 8 commits into from
Jul 13, 2024

Conversation

hwangdaesun
Copy link
Collaborator

@hwangdaesun hwangdaesun commented Jul 13, 2024

📌 관련 이슈

#368

🔑 주요 변경사항

리팩토링

  • Nutritionist 도메인의 분석 메서드 Analyzable 인터페이스를 만들어 추상화
  • 팩토리 메서드 패턴을 사용하여 각 분석 도메인(ProteinAnalyzer 등)을 생성하는 팩토리 클래스 생성
  • JVM의 stop the world 수를 줄이기 위해 팩토리 클래스를 싱글톤으로 사용

객체 생성 코드와 실제 객체 코드를 분리하여 단일 책임 원칙을 준수하여 유지보수 하기 용이해졌습니다.
요구사항이 추가되어 새로운 영양소를 분석할 때에도 기존 코드를 수정하지 않고 새로운 유형의 영양소를 추가할 수 있습니다.

기능 추가 및 테스트

  • 특정 날짜의 단백질,탄수화물,지방,칼로리를 분석하는 GetAllAnlysisUsecase 구현
  • 해당 API 통합 테스트 수행

Copy link
Collaborator

@LJH098 LJH098 left a comment

Choose a reason for hiding this comment

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

팩토리 패턴을 이용하여 확장성을 챙기셨네요 좋습니다.
싱글톤을 적용한 것 도 좋네요

@LJH098 LJH098 merged commit 978c11e into be Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants