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] #212 - Objective, KeyResult Entity Validator 분리 #213

Merged
merged 7 commits into from
Feb 24, 2024

Conversation

its-sky
Copy link
Member

@its-sky its-sky commented Feb 24, 2024

🚀PullRequest🚀

📟 관련 이슈

💻 작업 내용

  • ObjectiveService Validator 분리
  • KeyResultService Validator 분리
  • ObjectiveService와 KeyResultService에서 UserAuthrorization을 검증하는 로직을 기존에 UserService에 메시지를 보내서 검증하였는데 이 부분이 사실상 Long id값이 같은지 비교하는 부분이기 때문에 각 Validator에서 같은지 검증하는 것으로 변경함.
  • 변경 이후 ObjectiveService와 KeyResultService에서 UserService에 대한 의존성이 사라졌음.
  • 또한 Validator를 분리하면서 분기 처리에 대한 정확한 메시지를 표출할 수 있어서 코드의 직관성이 향상됨을 느꼈음.

📝 리뷰 노트

기존 로직을 메소드로 옮기는 과정에서 메소드의 Validation이 정확하지 않거나 분기 처리 순서를 변경하면서 분기 처리가 제대로 되지 않을 것 같으면 정확히 지적해주세요 ~~

@its-sky its-sky self-assigned this Feb 24, 2024
@0lynny 0lynny self-requested a review February 24, 2024 16:31
Copy link
Member

@0lynny 0lynny left a comment

Choose a reason for hiding this comment

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

아주 아름다운 코드군요... 저도 이렇게 반영하겠습니당~


public class KeyResultValidator {

private static final int ACTIVE_KEY_RESULT_NUMBER = 3;
Copy link
Member

Choose a reason for hiding this comment

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

p5;
이런 Constant는 common 모듈 안의 constant파일 만들어서 해줘도 좋을 것 같아요!

@its-sky its-sky merged commit aaedcdb into develop Feb 24, 2024
1 check passed
@its-sky its-sky deleted the feature/#212 branch February 27, 2024 16:42
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.

[Feat] Objective, KeyResult Entity Validator 분리
2 participants