Skip to content

[4주차] BLINK-ONCE #27

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

Closed
wants to merge 40 commits into from
Closed

Conversation

BLINK-ONCE
Copy link

No description provided.

Copy link
Contributor

@Livenow14 Livenow14 left a comment

Choose a reason for hiding this comment

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

자바 기초부분 정리 잘했네요!
객체 지향 부분에선 예제가 조금더 추가 되면 좋을 것 같아요.

Comment on lines +4 to +20
## 협업

- 합의에 도달하기 위한 갈등 과정은 자연스러운 것임을 받아들인다.

- 서로에게 기대하는 바를 명확히 한다. 무루숭실한 표현은 추후 갈등이나 키운다. 따라서 기대한 산출물이 있다면 그것이 무엇인지 명확히 하고, 변경 가능성이 있는 것들은 그 내용이 무엇인지 미리 알려주는 것이 좋다.

- 내 의견과 다른 의견, 원래 계획에서 달라진 상항들을 포용하려고 노력한다. 전문 분야, 경험, 개인적 목표가 다르기 때문에 다른 의견이 나오는 것은 당연하다. 자신의 의견만 관철시키려 하기보다 조직의 목표 달성을 위해 구성원이 합의할 수 있는 사항을 정의해가는 것이 중요하다. 또한 상황 변화에 따른 계획 변경에 대해서도 유연하게 대처하는 자세가 필요하다.

- 다른 구성원과 유대감을 형성하거나 유지하기 위해 지속적으로 커뮤니케이션한다. 업무와 관련된 것뿐 아니라, 상대방이 관심을 보이는 정보를 공유하는 것도 한 방법이다. 예를 들면, 세미나 정보나 뉴스링크를 이메일로 보내주는 것이다. 때로 개인적인 경험을 공유하는 경우도 있으나 이것은 유대감의 긴밀도나 상대방의 특성에 따라 결정해야 할 문제다.

- 상호 신뢰는 협업에서 가장 중요한 부분이다. 신뢰를 쌓으려면 말뿐 아니라 행동으로 보여야 한다. 약속이나 기한을 잘 지키는 것이 대표적인 예다. 문제가 생겼을 때 바로 공유하고 이를 해결하기 위해 도움을 주고 받는 것도 신뢰를 쌓는 방법이 될 수 있다.

- 협업 도구를 적극적으로 활용하라. 구글 드라이브, 에버노트, 트렐로, 레드 펜, 인비전, 마인드 마이스터, 깃허브 등. 프로젝트의 성격과 산출물의 유형에 따라 적합한 도구를 이용하는 것도 협업의 성과에 큰 도움을 준다.

- 협업에 방해되는 요인이 있다면, 구성원 또는 당사자와 공유하고 정정될 수 있도록 초기에 노력하는 것이 중요하다. 단, 특정 구성원이 다른 구성원 앞에서 당황스러움을 느끼게 해서는 안 된다.


Copy link
Contributor

Choose a reason for hiding this comment

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

좋은 의견.

Comment on lines +56 to +59
#### 메시지가 객체를 결정
- 객체가 최소한의 인터페이스를 가질 수 있게 된다.
- 객체는 충분히 추상적인 인터페이스를 가질 수 있게 된다.
- 객체가 충분히 추상적이면서 미니멀리즘을 따르는 인터페이스를 가지게 하고 싶다면 메시지가 객체를 선택하게 하자.
Copy link
Contributor

Choose a reason for hiding this comment

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

메시지가 제일 중요하다! 라는 말의 정리본이라 볼 수 있겠네요

Comment on lines +90 to +119
## DTO(Data Transfer Object)
데이터가 포함된 객체를 한 시스템에서 다른 시스템으로 전달하는 작업을 처리하는 객체이다. (레이어 간의 통신용도로 오가는 객체를 DTO라 하고, 특정한 비즈니스 값을 담는 객체를 VO라 한다.)


데이터를 오브젝트로 변환하는 객체이다.(주체가 누구인가를 아는 것이 중요하다)

DTO에서 Object는 우리가 만드는 DTO클래스이다. 아래는 PersonDTO 예시이다.
```java
class PersonDTO
private String name;
private int age;

public void setName(String name){
this.name = name;
}

public String getName(){
return this.name;
}

public void setAge(int age){
this.age = age;
}

public int getAge(){
return this.age;
}
}
```

Copy link
Contributor

Choose a reason for hiding this comment

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

GOOOD

Copy link
Contributor

Choose a reason for hiding this comment

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

근데 GET, SET을 다여는건 좋진 않아요. 상황에 따라 하는 것이 좋습니다.

Copy link
Author

Choose a reason for hiding this comment

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

Comment on lines +130 to +138
## VO(Value Object)
- 필요성: network traffic 감소
- 장점: 비 서버 측 클라이언트도 네트워크 오버헤드 없이 영속성 데이터에 엑세스 할 수 있다. 데이터 전달을 위해 가장 효율적인 방법이다.
- 단점: 클래스의 선언을 위해 많은 코드가 필요하다. 따라서 파일 수가 많아지고 관리도 힘들다.


간단히 말하면 값을 위해 쓴다. 자바는 값 타입을 표현하기 위해 불변 클래스를 만들어 사용한다. (불변 클래스는 readOnly 특징을 가진다. 예로, String, Integer, Color 클래스가 있다.) 이런 클래스는 중간에 값을 바꿀 수 없고 새로 만들어야 한다. (Color클래스의 경우 Red라는 값을 표현하기 위해 Color.RED처럼 호출했을 때 값을 표현하기 위해 getter 기능만이 존재한다.)


Copy link
Contributor

Choose a reason for hiding this comment

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

살짝 부족한 설명.
예제가 더 필요할거 같아요.

Comment on lines +121 to +142
## 람다 표현식(lambda expression)
메소드를 하나의 식으로 표현한 것이다.
```java
// 메소드
int min(int x, int y) {
return (x < y) ? x : y;
}


// 람다 표현식
(x, y) -> (x < y) ? x : y;


// 익명 클래스
new Object() {
int min(int x, int y) {
return (x < y) ? x : y;
}
}
```

위처럼 메소드를 람다 표현식으로 쓰면 클래스를 작성하고 객체를 생성하지 않아도 메소드를 사용할 수 있다.
Copy link
Contributor

Choose a reason for hiding this comment

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

람다 표현식이 나온 배경, 언제부터 사용가능한지도 정리해볼만 한듯!

remove code don't be used. added annotation.
계산가능여부를 판단하는 코드를 추가함. 계산가능할 경우에는
계산을 진행할 Performer class에 있는 메소드를 호출하여
배열로 저장된 식을 인자로 전달한다.
Added Performer class추가. 식을 저장하는 String[] formula.
그리고 받아온 인자를 세팅해주는 메소드 추가.
Performer 클래스에서 String 배열 값을 세팅하는 메소드를
생성자로 변경함.
메소드에 static 선언을 하지 않아 메소드를 호출한 후 인자를
변수에 저장하지 못하는 문제 수정.
계산을 수행하는 메소드 performCal() 추가. 배열과 결과값을
저장하기 위한 변수들 static 선언.
0으로 나눌 경우 발생하는 문제를 해소하기 위해 예외처리 추가.
ArithmethicException의 경우 정수를 0으로 나눌 때 에러를 감지하기
때문에 클래스 Performer에서 인자를 전달해줄 때와 클래스
CalculateNum의 메소드 divNum()에서 받는 파라미터를 정수형으로
설정하였다.
public class Calculator {
public static void main(String[] args) throws IOException {
Input input = new Input();
input.inputFormula();
Copy link
Member

Choose a reason for hiding this comment

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

패키지의 메인만 보면 공식을 입력 받는게 끝인데
계산은 어떤 객체가 책임을 지고 있는지 와닿지 않습니다.

public void inputFormula() throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
this.arrayFormula = br.readLine().split(" ");// 공백을 기준으로 연산자, 피연산자 구분 후 배열에 삽입
for (int i = 1; i < arrayFormula.length; i += 2) {// 피연산자 중 숫자가 아닌 것이 있을 경우
Copy link
Member

Choose a reason for hiding this comment

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

홀수 index를 의미한 것 같은데
저는 그 홀수 index가 무엇을 의미하는지 모르겠습니다

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
this.arrayFormula = br.readLine().split(" ");// 공백을 기준으로 연산자, 피연산자 구분 후 배열에 삽입
for (int i = 1; i < arrayFormula.length; i += 2) {// 피연산자 중 숫자가 아닌 것이 있을 경우
if (isElementInt(arrayFormula[i - 1]) == false || isElementInt(arrayFormula[i + 1]) == false) {
Copy link
Member

Choose a reason for hiding this comment

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

이미 boolean을 return 하는애가 false 인지 검증을 해야한다면
그 상황이 true인 경우로 메소드를 만들고 네이밍을 하는게 더 맞지 않을까요?

break;
}
}
if (isComputable) {// 피연산자가 들어갈 부분에 모두 들어갔다면 연산 시작
Copy link
Member

Choose a reason for hiding this comment

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

computable 하지 않다면?
사용자는 입력을 했지만 아무 것도 안되는 것처럼 보이는데 의도된게 맞나요?

return true;
}
catch(IllegalArgumentException e){// 숫자로 변경이 불가한 경우
System.out.println("입력된 값이 숫자가 아닙니다.");
Copy link
Member

Choose a reason for hiding this comment

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

입력된 어떤 수가 숫자가 아닐까요?

private String[] arrayFormula;
private boolean isComputable = true;

public void inputFormula() throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

검증과 계산의 책임을 한 곳에서 하는 것 같아 보이네요

@Livenow14 Livenow14 closed this Feb 21, 2021
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.

3 participants