Programming 91

코드 품질올리기, 코드 설계 - 2 분기중접 줄이기 (1/3)

가. 이해하기 어렵게 만드는 분기중첩 조건 분기는 조건에 따라 처리 방식을 다르게 하는데 사용되는 프로그래밍 언어의 기본 제어 구조입니다. 그런데 조건 분기를 어설프게 사용하면 악마가 되어 개발자를 괴롭힙니다. 잘못된 예 if ( 0 < member.hitPoint ) { //살아 있는가? if (member.canAct()) { //움직일 수 있는가? if(magic.costMagicPoint

Programming/기타 2023.08.28

JSESSIONID만으로 세션 유효성 검증하는 방법

1. 아래와 같이 Interceptor Class를 정의한다. Prehandler에 세션체크 로직을 정의한다. package egovframework.example.com; import javax.servlet.ServletContext; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.slf4j.Logger; import org.slf4j.loggerFactory; import org.springframework.web.servlet.ha..

Programming/Java 2023.08.28

코드 품질올리기, 코드 설계 - 1 이름의 중요성과 모델링

"내 코드가 이상한가요" 센바다이아 著 를 읽고 정리한 글입니다. 가. 이름의 중요성과 모델링 1. 기술을 중심으로 이름을 짓거나, 일련번호를 매겨 이름을 지으면 코드에서 어떠한 의도도 읽어낼수 없습니다. 읽고 이해하는데 시간이 오래 걸릴 뿐더러 기능을 일일이 매핑시킨 알람표(스프레드시트)는 바쁜업무로 인해 유지보수가 거의 이루어 지지 않습니다. 권장하지 않는 예 1) 기술중심 명명 class MemoryStateManager { void changeIntValue01 (int changeValue) { updateState01(); ... } 종류 예 컴퓨터 기술 유래 memory, cache, thread, register 등 프로그래밍 기술 유래 function, method, class, modu..

Programming/기타 2023.08.28

yarn install 시 발생하는 오류 해결

우선 Registry 주소 확인하기 $ npm config get registry $ yarn config get registry Registry 주소 변경하기 $ yarn config set registry https://registry.npmjs.org/ NPM이나 yarn으로 아래 오류 발생할때 There appears to be trouble with your network connection. Retrying... 일반적인 방법 $ yarn config delete proxy $ yarn config delete https-proxy $ yarn install --network-timeout 600000 $ yarn cache clean 위 것도 안되면 yarn.lock 파일 지워보자.. 난 이..

어플리케이션 구성요소별 Naming Convention

Oracle 가이드는 다음과 같으니 참고하시길 https://www.oracle.com/java/technologies/javase/codeconventions-introduction.html Code Conventions for the Java Programming Language: 1. Introduction We’re sorry. We could not find a match for your search. We suggest you try the following to help find what you’re looking for: Check the spelling of your keyword search. Use synonyms for the keyword you typed, for example,..

Programming/기타 2023.06.26

NPM 운영환경으로 이전할때 발생하는 버그 및 FIX

[에러] Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. 본 포스팅은 아래의 링크를 참조하였습니다. 제 삽질을 덜어주셔서 감사합니다. https://velog.io/@black-pepper/Invalid-options-object.-Dev-Server-has-been-initialized-using-an-options-object-that-does-not-match-the-API-schema [에러] Invalid options object. Dev Server has been initialized using an options object tha..

NPM 패키지 매니저 Linux에 설치하기

nvm 공식 사이트 를 참고해 보자. curl, wget 둘 중 하나로 설치하면 된다. // curl으로 설치하기 # curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash // wget으로 설치하기 #wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash ~.bash_profile에 반영하자. # source .bash_profile nodejs v9.5.0 설치 # nvm install v9.5.0 // 아래의 방법으로 설치가능한 버전을 확인해도 된다. # nvm list-remote |grep 17.... ..

(React) 앱 초기화 및 몇가지 패키지

NPM을 활용한 앱 초기화 (프로젝트 생성) npx create-react-app app-name 반응형 웹을 위한 패키지 npm install react-responsive npm install @types/react-responsive 부트스트랩 설치 import "../node_modules/bootstrap/dist/css/bootstrap.min.css"; import "../node_modules/bootstrap/dist/js/bootstrap.bundle"; > npm install bootstrap@^5.0.0-alpha1 유용한 아이콘 및 폰트 import { faLinkedin } from "@fortawesome/free-brands-svg-icons"; "@fortawesome/f..

GraphQL Apollo 서버와 MySQL 연동

※ NPM 패키지 매니저 사용 ※ 원문 참조(본 포스팅은 원문의 상당량을 참조하였습니다.) https://hoons-up.tistory.com/53 [Develop/Node&Express] Express / GraphQL / Appllo 맛보기 2 (Mysql) Express / GraphQL / Appllo 맛보기 2 (Mysql) 이번에는 Expess, GraphQL, Apollo-Server, Mysql을 사용해서 Express와 Mysql 연결과 Apollo-Server를 사용한 GraphQL 서버를 간단하게 만들어 볼려고한다. 추후 다음 포스팅을 통 hoons-up.tistory.com 소스코드 : https://github.com/armyost/graphql-appllo GitHub - arm..

Programming/기타 2023.04.01