Skip to content

[SO-182] refactor: 플래너, 예비부부의 Tag를 String으로 변경 및 매개변수 개수 감소#61

Merged
nitronium102 merged 5 commits intodevelopfrom
feature/SO-182-refactor-planner-customer-tag
Aug 14, 2023
Merged

[SO-182] refactor: 플래너, 예비부부의 Tag를 String으로 변경 및 매개변수 개수 감소#61
nitronium102 merged 5 commits intodevelopfrom
feature/SO-182-refactor-planner-customer-tag

Conversation

@nitronium102
Copy link
Copy Markdown
Contributor

작업 개요

Tag 테이블을 삭제하고 String으로 바꿈에 따라 플래너 및 예비부부의 Tag를 String으로 변경

작업 분류

  • 버그 수정
  • 신규 기능
  • 프로젝트 구조 변경

작업 상세 내용

  1. 기존에 삭제되지 않았던 Item, Portfolio Tag 관련 entity, controller, service, repository, dto, mapper 삭제
  2. Planner와 Customer의 Tag 필드를 String으로 변경
  3. Customer 생성자 매개변수 개수를 줄이기 위한 파라미터 객체 생성 후 dto와 mapper에 적용

생각해볼 문제

빌더 패턴을 쓰면 좋다고는 하지만 저희처럼 필수 변수가 너무 많은 경우에는 지금처럼 파라미터 객체를 생성해서 묶어주는 편이 더 나은 것 같습니다.
빌더 패턴은 선택 변수가 많은 경우에 더 적합한 것 같아요....

@nitronium102 nitronium102 added 🛠refactor 리팩토링한 경우 👀리뷰필요 리뷰가 필요한 경우 labels Aug 14, 2023
@nitronium102 nitronium102 self-assigned this Aug 14, 2023
Copy link
Copy Markdown
Contributor

@lina1919 lina1919 left a comment

Choose a reason for hiding this comment

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

네 저도 parameter를 쓰는 편이 깔끔하고 좋은 것 같습니다!
이제 tag 관련 복잡한 로직들이 없어져서 마음이 아주 편-안 합니다.
수고 많으셨어요!

Comment on lines +21 to +31

@Builder
public CustomerTagListDto(String portfolioTagList, String plannerTagList, String dressTagList,
String studioTypeTagList, String studioFocusTagList, String makeupTagList) {
this.portfolioTagList = portfolioTagList;
this.plannerTagList = plannerTagList;
this.dressTagList = dressTagList;
this.studioTypeTagList = studioTypeTagList;
this.studioFocusTagList = studioFocusTagList;
this.makeupTagList = makeupTagList;
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

인자 개수가 6개라서 아슬아슬하게 이걸로 묶었습니다
만약 인자가 더 늘어난다면 화면별로 분할해서 portfolioTag, plannerTag / dressTag, StudioTypeTag, studioFocusTag, makeupTag 이런 식으로 나눌 것 같아요

Comment on lines 50 to 61
@Builder
public Customer(String weddingDate, String budget) {
this.weddingDate = weddingDate;
public Customer(Boolean weddingDateConfirmed, String region, String budget, CustomerTagListDto customerTagList) {
this.weddingDateConfirmed = weddingDateConfirmed;
this.region = region;
this.budget = budget;
this.portfolioTagList = customerTagList.getPortfolioTagList();
this.plannerTagList = customerTagList.getPlannerTagList();
this.dressTagList = customerTagList.getDressTagList();
this.studioTypeTagList = customerTagList.getStudioTypeTagList();
this.studioFocusTagList = customerTagList.getStudioFocusTagList();
this.makeupTagList = customerTagList.getMakeupTagList();
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

원래 customBuilder를 생성하려 했으나 필수 인자가 너무 많아 파라미터 객체를 사용하여 묶어주었습니다.

@nitronium102
Copy link
Copy Markdown
Contributor Author

네 저도 parameter를 쓰는 편이 깔끔하고 좋은 것 같습니다! 이제 tag 관련 복잡한 로직들이 없어져서 마음이 아주 편-안 합니다. 수고 많으셨어요!

진짜 태그 관련 중간 테이블 없애니까 db 구조도 엄청 깔끔해지고 좋은 것 같아요~!👍👍👍

@nitronium102 nitronium102 merged commit bdc0775 into develop Aug 14, 2023
@nitronium102 nitronium102 removed the 👀리뷰필요 리뷰가 필요한 경우 label Aug 14, 2023
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@nitronium102 nitronium102 mentioned this pull request Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠refactor 리팩토링한 경우

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants