-
Notifications
You must be signed in to change notification settings - Fork 301
feat : course, session 로직 구현 #745
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
base: jhm9595
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안녕하세요 형민님! 도메인 모델링 잘 진행해주셨습니다 👍
질문주신 payments 는 기존에 구현되어 있는 pojo 객체를 그대로 활용하고,
session, course 모델링에 집중하라는 의미로 생각됩니다 😄
몇 가지 간단한 코멘트 남겼습니다.
public interface Conditional { | ||
public boolean test(int currentNum); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FunctionalInterface
어노테이션을 명세하는 것과 하지 않는 것에는 어떤 차이가 있을까요?
private int classNo; | ||
private Sessions sessions; | ||
|
||
public int getClassNo() { | ||
return classNo; | ||
} | ||
|
||
public Sessions getSessions() { | ||
return this.sessions; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
과정(Course)은 기수 단위로 운영하며, 여러 개의 강의(Session)를 가질 수 있다.
요구사항 속 기수는 하나의 과정에서 생성되는 N 개의 강의를 나타내는 걸로 보이네요. 😄
- 과정: TDD, 클린 코드 with Java
- 강의: TDD, 클린 코드 with Java 19기
- 강의: TDD, 클린 코드 with Java 18기
- 강의: TDD, 클린 코드 with Java 17기
CoverImage(){ | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기본 생성자를 default package private 접근제한자로 만드신 이유가 있을까요?
public enum ImageType { | ||
|
||
GIF("GIF"), | ||
JPG("JPG"), | ||
JPEG("JPEG"), | ||
PNG("PNG"), | ||
SVG("SVG"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
상수의 나열을 enum 으로 풀어내기 💯 👍
public Session() { | ||
this(new CoverImage(), LocalDate.now(), LocalDate.now()); | ||
} | ||
|
||
public Session(CoverImage coverImage, LocalDate startDt, LocalDate endDt) { | ||
this.coverImage = coverImage; | ||
this.startDt = startDt; | ||
this.endDt = endDt; | ||
this.status = SessionStatus.READY; | ||
this.students = new ArrayList<>(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
생성자 체이닝 활용 👍
public boolean isNotOwner(NsUser loginUser) { | ||
return !this.isOwner(loginUser); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
부정형 질의문 제공 👍 👍
public void asFree() { | ||
this.capacity = Integer.MAX_VALUE; | ||
this.cost = BigDecimal.ZERO; | ||
conditional = (currentNum) -> true; | ||
} | ||
|
||
public void asPaid(int capacity, BigDecimal cost) { | ||
this.capacity = capacity; | ||
this.cost = cost; | ||
conditional = (currentNum) -> currentNum < this.capacity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
처음 Session 이 생성될 때부터 유/무료가 나뉠 수 있도록 팩터리 메서드를 제공하는 것도 방법일거 같네요 😄
유료 강의의 경우 결제는 이미 완료한 것으로 가정하고 이후 과정을 구현한다.
결제를 완료한 결제 정보는 payments 모듈을 통해 관리되며, 결제 정보는 Payment 객체에 담겨 반한된다.
이 내용이 무슨말인지 몰라 구현을 하진 못했습니다.