전체 글
-
스프링 가이드 - 간단한 RESTful API 만들어보기개발 나누고 더하기/자바, 스프링 2024. 2. 13. 11:38
들어가며 토비의 스프링 유튜브 채널(https://www.youtube.com/watch?v=wlOR5ehWSjE&list=PLv-xDnFD-nnnZUzISvE6a8JnKZme-tRGU&index=2)에서 스프링 가이드를 따라하며 15분 만에 API만드는 예제가 있어 나도 따라해보았다. 다른 목적도 하나 있는데, 부하 테스트용 샘플 API가 필요했다. 새로 입사한 회사에서 백엔드팀 전체 부하테스트를 했었다. 환경 설정에 힘들어하는 주니어들도 있고 일관된 테스트 환경과 지표 분석을 위해 애플리케이션과 그라파나를 도커로 구성하는게 좋을 것 같았다. 일단 집에서 도커 테스트 환경을 만들고 회사 프로젝트에 적용할 계획이다. 준비물 IDE와 JDK - 여기선 IntelliJ Community Edtion과 자바..
-
개발자의 글쓰기 - 릴리스 노트, 장애 보고서책책책 책을 읽읍시다/프로그래밍 2023. 8. 11. 22:25
고객에게 유용한 정보를 쓰자 개발자 관점과 고객 관점 체인지 로그는 개발자가 변경한 내용을 적은 것이다. 하지만 체인지 로그를 보는 독자는 뭔가 새로운 것, 바뀐 것, 그래서 자기에게 좋거나 유익하거나 어떤 행동을 해야 할지 명확하게 지시하는 것을 보고 싶어 한다. 체인지 로그를 사내 개발자끼리만 본다면 한 일만 담백하게 적어도 상관없다. 하지만 외부 개발자나 일반 사용자가 보는 체인지 로그를 쓸 때는 개발자 관점이 아니라 고객 관점에서 써야 한다. 고객 관점으로 쓰려면 변경사항이 고객에게 끼치는 영향을 체인지 로그에 추가해서 기술하면 된다. 예를 들어 다음과 같이 개발자가 문제를 해결한 내용만 기술한 체인지 로그가 있다고 하자. 댓글에서 애니메이션 스티커 때문에 화면이 멈추는 문제를 해결했습니다. 이것..
-
개발자의 글쓰기 - 에러 메시지책책책 책을 읽읍시다/프로그래밍 2023. 8. 11. 21:39
에러 메시지의 목적은 사용자에게 에러가 났음을 알려주는 것이 아니라 사용자 스스로 에러를 해결하게 하는 것이다. 따라서 사용자 에러 메시지에는 에러의 내용, 에러의 원인, 에러 해결 방법이 포한돼야 한다. 에러 내용 : 오류로 인한 문제와 종류 에러의 원인 : 오류를 발생시킨 직접적이고 근본적인 원인 에러 해결 방법 : 사용자가 오류를 해결할 가장 쉽고 빠른 방법 회원 가입 중 휴대전화 번호를 01012345678 형식으로 입력해야되는데, 010-1234-5678로 잘못 입력한 경우에 위 규칙을 적용해보자. [에러 내용] 회원가입을 진행할 수 없습니다. [에러 원인] 휴대전화 번호를 잘못 입력하셨습니다. [에러 해결 방법] 휴대전화 번호 입력란에는 숫자만 입력하십시오. 에러 메시지를 보여주는 순서 에러 ..
-
개발자의 글쓰기 - 문장과 단락을 구조화하는 법책책책 책을 읽읍시다/프로그래밍 2023. 8. 8. 23:44
저자 : 김철수 들어가며 개발자로서 직업인으로서 갖추어야 할 글쓰기 방법에 대해 쉽게 알려주는 책이다. 토비의 스프링같이 완독 자체로도 의미있는 그런 난이도 있는 책을 읽고 난 뒤 머리를 식힐겸 읽어도 좋을 책이다. 신입때 이전 직장에 있을 때는 개발자가 코드만 잘 짜면 되는줄 알았다. 개발이란 작업을 코드로 구현하는 위주로 접근했던 때이다. 이직을 하고 난 뒤 생각이 바뀌어 개발에 대해 다시 고민하기 시작했고, PO, 디자이너, 동료 개발자, QA 등 제품과 관련된 모든 이해관계자와의 소통, 업무 지식 문서화와 같은 소프트 스킬이 개발의 반을 이룬다는 것을 깨달았다. 소프트 스킬이 부족하면 업무 성과가 나올수가 없다. 이번 책은 소프트 스킬 중 문서를 잘 작성하기 위한 기술적인 가이드를 해준다. 변수 ..
-
엘레강트 오브젝트 : Mock 대신 Fake 사용책책책 책을 읽읍시다/프로그래밍 2023. 8. 4. 00:09
단위 테스트에서 Mock은 객체 의존 관계를 대신해주기 때문에 편리하다. 특히 repository에 의존하는 service나 domain을 테스트할 때 repository 의존성을 대신해주어 속도도 빠르고 복잡한 데이터를 조사할 필요도 없어진다. 하지만 과도하게 사용할 경우 테스트가 장황해지고 리팩터링 내성이 저하된다. Fake는 이런 문제를 해결해준다. 다음 자기 자신을 새로운 환율로 변환할 수 있는 Cash 클래스를 보자. public class Cash { private final Exchange exchange; private final int amount; public Cash(Exchange exchange, int amount) { this.exchange = exchange; this.am..
-
엘레강트 오브젝트 - 퍼플릭 상수(Public Constant)를 사용하지 말자책책책 책을 읽읍시다/프로그래밍 2023. 8. 1. 23:35
'상수(constant)'라고도 불리는 public static final 프로퍼티는 객체 사이에 데이터를 공유하기 위해 사용하는 매우 유명한 메커니즘이다. 글자 그대로 상수를 사용하는 이유는 데이터를 공유(또는 다른 객체를 공유)하기 위해서인데, 객체들은 어떤 것도 공유해서는 안된다. 대신 독립적이어야 하고 '닫혀 있어야(closed)'한다. 간단하게 말해서 상수를 이용한 공유 메커니즘은 캡슐화와 객체지향적인 사고 전체를 부정하는 일이다. 다음 예제는 구조화된 데이터를 Writer 객체에 기록하고, 각 줄을 '개행(new line) 문자'로 종료하는 메서드를 나타낸 것이다. public class Records { private static final String EOL = "\r\n"; void wr..
-
엘레강트 오브젝트 - 주 생성자 재활용책책책 책을 읽읍시다/프로그래밍 2023. 8. 1. 00:07
응집도가 높고 견고한 클래스에는 적은 수의 메서드와 상대적으로 더 많은 수의 생성자가 존재한다. 생성자의 개수가 더 많을수록 클래스는 더 개선되고, 사용자 입장에서 클래스를 더 편하게 사용할 수 있다. 아래와 같이 Cash란 클래스가 있고 다양한 방법으로 Cash 인스턴스를 생성하고 싶은 경우 다음과 같이 여러 종류의 생성자를 활용한다. public class Cash { private int dollars; public Cash(int dollars) { this.dollars = dollars; } public String usd() { return String.format("$ %d", this.dollars); } } new Cash(30); new Cash("$29.95"); new Cash(2..
-
엘레강트 오브젝트 - 접미사 er 사용을 자제하자책책책 책을 읽읍시다/프로그래밍 2023. 7. 30. 22:57
저자 : Yegor Bugayenko 엮자 : 조영호 들어가며 저자는 순수 OOP를 지향한다. 이러한 방식은 무조건 옳다라고 말하는 점에서 명쾌하기도 하고 너무 극단적이라 난해하기도 했던게 흥미로웠다. 이보다도 엮자 서문이 더 흥미로웠다. 보통은 책 내용에 동조하며 좋은 면을 위주로 소개하는데 반해 이 책을 읽을 때 주의할 점 먼저 설명한다. 엮자인 조영호 님의 저서인 '객체지향의 사실과 오해', '오브젝트'을 읽으며 객체지향에 대한 생각이 일관되게 잘 정리된 흔들리지 않을 느낌을 받았는데, 저자도 생각이 다르지만 결은 같은 사람 같았다. 좌파 정치인이 우파 정치인의 책을 출간한 느낌이랄까? 소개된 내용 중 실무에서 했던 내 과오와 연결되는 것이 많아서 반성문 쓴다라는 느낌으로 정리해보았다. -er로 끝..