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] 나아연 로그인 #2

Open
wants to merge 16 commits into
base: ay-eonii
Choose a base branch
from
Open

Conversation

ay-eonii
Copy link
Member

No description provided.

@anxi01
Copy link
Member

anxi01 commented May 15, 2024

dto를 record로 만드신 이유가 궁금해요 !

@ay-eonii
Copy link
Member Author

@anxi01

dto를 record로 만드신 이유가 궁금해요 !

dto는 불변해야하고 getter가 필요하다는 점을 고려해서

  • 멤버변수는 private final로 선언된다
  • 필드별 getter가 자동으로 생성된다
  • 모든 멤버변수를 인자로 하는 public 생성자를 자동으로 생성한다
  • equals, hashcode, toString을 자동으로 생성한다

위 특징을 가진 record를 DTO로 사용하면 @Getter@AllArgsContructor 어노테이션을 제거할 수 있다는 장점이 있다고 느꼈습니다.

@ay-eonii ay-eonii self-assigned this May 16, 2024
@anxi01
Copy link
Member

anxi01 commented May 16, 2024

@ay-eonii
자세한 답변 감사합니다:)

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.

2 participants