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

[안예성] 과제 제출합니다 #1

Open
wants to merge 18 commits into
base: yeseong
Choose a base branch
from

Conversation

anys34
Copy link

@anys34 anys34 commented Jun 26, 2023

1. 구현 여부

요구사항 구현 여부 *

  • 학생은 원서를 제출할 수 있습니다.
  • 학교는 받은 원서를 점수 순으로 다음 정보를 확인할 수 있습니다.
    • 지원자의 이름, 전화번호, 출신 중학교
    • 지원자의 성적, 출결, 가산점
  • 학생은 자신이 제출한 원서의 상태를 확인할 수 있습니다.

제한 사항 구현 여부 *

  • 원서는 한 번만 제출할 수 있습니다.

테스트

  • (진행한 테스트 케이스를 모두 적어주세요)

2. 진행 중 느낀점

과제를 진행하며 한 고민들 *

  • class를 어떤 식으로 나눠야 하는지 고민하였습니다.
  • 학생 데이터를 어떤 형식으로 저장을 해야하는지 생각한 후 무슨 컬렉션 프레임워크를 써야할지 고민했습니다.

발생한 이슈와 해결 방법

  • 자신의 원서를 조회할 때 for문으로 자신의 이름과 일치하면 출력하는 형식으로 코드를 작성하였는데 이것이 비효율 적이라 생각하여 stream으로 이름을 필터링 하여 출력을 할 수 있도록 하였습니다.
  • student의 멤버변수들을 static으로 생성하였는데 외부의 접근과 수정을 막기 위해 private로 변경하였다.

질문

  • (질문을 모두 적어주세요)

anys34 added 17 commits June 14, 2023 01:26
- School 클래스 생성
- Student 클래스 생성
- 인스턴스 School, Student 생성
- name, tel, nativeSC, score, attendance, point 멤버 변수 생성
- name, tel, nativeSC, score, attendance, point의 Getter and Setter 추가
- setData 메서드 생성
- 각 학생의 데이터 저장
- setData를 호출 하여 6개의 데이터 입력
- Arraylist인 studentData에 입력값 추가
- submit 메서드로 학생의 Arraylist 값 보내기
- 받은 데이터를 Arraylist인 studentsData에 저장
- 처음 제출이 되면 submit이 true로 바뀐 후 bssm의 submit메소드 호출
- getData를 호출 했을 때 만약 true이면 null을 return
- bssm의 submit메소드에서 null이 아닐 경우 Arraylist에 데이터 저장
- School클래스에서 search메서드 생성
- sort함수 안에 람다식 사용하여 성적 정렬
- 기본 Pass 변수 값 false
- pass메서드 호출 시 합불여부 판단 후 pass값 true로 변경
- check메서드에 name값 보낸 후 이름이 일치하면 원서 내용 출력
- for문으로 이름을 검색하는 것이 비효율적임
- 사용하지 않는 함수임으로 삭제함
@anys34 anys34 requested a review from a team as a code owner June 26, 2023 03:31
@gimhanul
Copy link
Member

1. 구현 여부

요구사항 구현 여부 *

  • 학생은 원서를 제출할 수 있습니다.

  • 학교는 받은 원서를 점수 순으로 다음 정보를 확인할 수 있습니다.

    • 지원자의 이름, 전화번호, 출신 중학교
    • 지원자의 성적, 출결, 가산점
  • 학생은 자신이 제출한 원서의 상태를 확인할 수 있습니다.

제한 사항 구현 여부 *

  • 원서는 한 번만 제출할 수 있습니다.

테스트

  • (진행한 테스트 케이스를 모두 적어주세요)

2. 진행 중 느낀점

과제를 진행하며 한 고민들 *

  • (고민들을 모두 적어주세요)

발생한 이슈와 해결 방법

  • (발생한 이슈와 해결 방법을 모두 적어주세요)

질문

  • (질문을 모두 적어주세요)

@anys34

이 내용 채우셔야 최종 제출입니다! 채워주세용
어떻게 하는지 모르겠으면 갠톡주세요!

@anys34 anys34 closed this Jun 26, 2023
@anys34 anys34 reopened this Jun 26, 2023
@gimhanul
Copy link
Member

@anys34

image

여기서 수정하시면 댐ㄴ디ㅏ...

@gimhanul
Copy link
Member

🙌 @anys34 님 안녕하세요

밤돌이로 백엔드 개발 팀입니다.

먼저, 과제 전형 기간 동안 수고하셨습니다!
과제를 수행하시면서 많이 배우셨길 바랍니다.

과제를 준비하면서 얻어가셨길 바랐던 것은

1. 자기주도적으로 공부하기
2. 객체지향적으로 설계하기
3. 깃허브 사용법 익히기

인데요, 다들 어느정도 얻어가신 것 같아 뿌듯하네요.

과제 전형 점수 안내드립니다.

자세한 감점 사유가 궁금하면 따로 연락주세요.

코드 가독성 실행 학구열 성실성 테스트 총점
30 26 28 10 0 94

총점 94점으로, 1차 과제 전형에서 합격하셨습니다.
오늘 안으로 면접 일정을 잡아 개인적으로 연락드리겠습니다!

감사합니다.

Copy link
Member

@gimhanul gimhanul left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~
리뷰 참고해서 반영하셔도 되고, 그대로 머지하셔도 됩니다!

Copy link
Member

Choose a reason for hiding this comment

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

Pull Request Template의 역할에 대해 알아보세요
그리구 여기서 이 파일을 수정했을 때 실제로 나타나지 않은 이유에 대해서도 생각해보시면 좋을 것 같아요

Copy link
Member

Choose a reason for hiding this comment

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

이 파일도 마찬가지입니다!
README 파일에 역할에 대해 알아보세용


// TODO-1 이밤돌 학생 원서
// 이밤돌 학생이 부산소프트웨어마이스터고등학교에 낼 원서를 작성합니다.

leebamdol.setData("이밤돌", "01012345678", "알이중학교", 52, 9, 2);
Copy link
Member

Choose a reason for hiding this comment

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

위에서 School 객체를 만든 만큼 중학교 넣을 때도 School 객체를 사용했으면 더 좋았을 것 같아요

Copy link
Member

Choose a reason for hiding this comment

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

그리고 setData같은 네이밍은 의미가 잘 드러나지 않아요
이 메서드가 해야 하는 역할은 원서를 작성하는 건데, 이밤돌씨 객체에 데이터를 넣어주고 있으니까요.
그리고 이렇게 그냥 모든 값을 넣어주는 메서드는 생성자에 넣는 게 깔끔할 듯 하네요

// 이밤돌 학생이 원서를 제출합니다.

bssm.submit(leebamdol.getData());
Copy link
Member

Choose a reason for hiding this comment

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

여기두 마찬가지입니다!
원서를 제출해야 하는데 getData() 메서드를 호출하고 있죠.
원서 제출 = 데이터 가져오기 의미가 맞지 않아요


// TODO-6 자신의 원서 상태 조회
// 이밤돌 학생이 본인의 원서 상태를 조회합니다.

bssm.check(leebamdol.getName());
Copy link
Member

Choose a reason for hiding this comment

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

본인의 원서 상태 조회는 이렇게 bssm 객체에 의존하지 말고, leebamdol 객체에서 책임지는 게 논리상 좋겠네요


// 점수 순으로 출력
public static void search() {
studentsData.sort((student1, student2) -> Integer.compare(student2.getScore(), student1.getScore()));
Copy link
Member

Choose a reason for hiding this comment

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

비교하는 부분 좋네요

Comment on lines +27 to +28
// 학생의 원서 저장
public void setData(String name, String tel, String nativeSC, int score, int attendance, int point) {
Copy link
Member

Choose a reason for hiding this comment

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

원서와 학생 객체를 나누는 게 좋겠네요

Comment on lines +79 to +81
public void setScore(int score) {
this.score = score;
}
Copy link
Member

Choose a reason for hiding this comment

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

setter는 남용하지 않아야 합니다
관련 키워드로 검색해보세용

Comment on lines +39 to +49
// 학생 데이터 반환
public ArrayList<Student> getData() {
if (!submit) { // 제출을 한번도 하지 않았을 경우
submit = true;
return studentData;
}
else { // 제출을 한번이라도 한 경우 null return
System.out.println(getName() + "님 이미 제출하였습니다.");
return null;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

이 메서드의 역할이 이상해요.
호출 시점이 정해져 있다고 해야하나?
차라리 setData() 메서드에서 submit을 true로 만들어주는 게 좋지 않을까요?

private int point; // 가산
private boolean submit = false; // 제출 여부
private boolean pass = false; // 합불 여부
private ArrayList<Student> studentData = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

변수 이름을 제출 이력 쯤으로 두는 게 좋을 것 같아요.

@gimhanul gimhanul changed the base branch from main to yeseong June 29, 2023 22:57
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