분류 전체보기
-
WebSocket 이론토이프로젝트/웹소켓채팅 2022. 1. 8. 23:11
프로토콜 부터 이해하기 프로토콜은 컴퓨터나 원거리 통신 장비에서 메시지를 주고 받는 양식과 규칙의 체계이다. 우리가 1,2,3,4 를 하나 둘 셋 넷으로 알고 외국에서도 one two three four로 아는 것처럼 통신 데이터도 일종의 공통 양식이 필요한 것이다. 물론 이렇게 간단하게 양식이 설계되지 않고, 신호 체계, 인증, 오류감지, 수정, 단방향, 반이중, 전이중, 재전송, 수신 완료 과 같이 OSI 계층을 지나면서 얻는 헤더 값들을 주고받게 된다. WebSocket 이란 웹 소켓은 하나의 TCP접속에 전이중 통신(양방향 통신) 채널을 제공하는 컴퓨터 통신 프로토콜이다. 브라우저혹은 애플리케이션이 이 프로토콜을 지원해야 된다는 것이 선제 조건이지만, 지금의 브라우저 대부분은 이 프로토콜을 지원한..
-
Maven Gradle Ant - 자바 빌드도구도구/빌드도구 2022. 1. 8. 01:59
빌드란 ? 소스 코드 파일을 컴퓨터에서 실행할 수 있는 독립 소프트웨어 가공물로 변환하는 과정 또는 결과물이다. Java 코드, xml,jpg,jar,properties 파일을 JVM이나 톰캣같은 WAS가 인식할 수 있는 구조로 패키징 하는 결과물 이라 할 수 있겠다. 빌드 도구란? 소스코드에서 어플리케이션 생성을 자동화 하기 위한 프로그램이다. 빌드는 코드를 사용 혹은 실행 가능한 형태로 컴파일 , 링킹, 패키징 하는 것을 포함한다. 기본적으로 빌드 자동화는 아래와 같은 정형화된 다양한 작업을 스크립팅하거나 자동화 하는 행위이다. 1 - 종속성 다운로드 2 - 소스코드를 바이너리 코드로 컴파일 3 - 바이너리 코드를 패키징 4 - 테스트 실행 5 - 프로덕션 시스템에 배포 Maven Apache Ant..
-
GC(Garbage Collection) 컬렉션 과 Heap 영역JAVA공부/JVM 2022. 1. 6. 00:22
Garbage Collection 이란 자바에서는 새로 생성 되는 객체에 대한 메모리들이 Heap영역에 저장된다. 초기 C언어 같은 경우는 이런 참조 변수들에 대한 메모리 관리가 중요했다. 더이상 쓰지 않는 변수들에 대한 메모리 할당을 없애주어야 하는 것이다. 이를 해주지 않는다면, 프로그램에 규정된 메모리가 full되어 누수가 되거나 멈추게 되는 것이다. 그러나 자바에서는 GC라는 장치가 있어, 우리가 더이상 참조하지 않는 객체에 대해서 제거를 해주게 된다. 위 사진과 같이 unreachable (힙 영역 내에서 자신들끼리 참조하는 객체들)이 GC 대상이 된다. 이 때, GC에서 공통적으로 수행되는 단계를 1. Stop-The-World 2. Mark And Sweep 이라고 한다. Stop-The-W..
-
JVM 기초 원리JAVA공부/JVM 2021. 12. 31. 03:32
더보기 Class Loader Class파일들을 읽어서 Runtime Data Area에있는 각 영역에 맞는 정보들을 적재하는 역할을 한다. Execution Engine Method Area의 바이트 코드를 제공받아, class에 정의된 내용대로 바이트 코드를 실행 한다. 실행방식에는 Interpreter, JIT(Just In Time)가 있다. Interpreter - 바이트 코드를 한줄 씩 해석하여 실행하는 방식이라 속도가 느리다. JIT (Just In Time) - 바이트 코드를 컴퓨터 프로세서(CPU) 직접 보낼 수 있는 명령어로 바꾸는 프로그램이다. (컴파일) ※JIT 는 이미 한번 읽어서 기계어로 변경한 소스코드는 또, 컴파일하지 않으며 저장소에 기계어로 저장한다. 따라서 인터프리터를 보..
-
JDK, JREJAVA공부/JVM 2021. 12. 30. 00:35
자바는 JVM (Java Virtual Machine)을 이용하여 각기 다른 운영체제에서 실행가능하게 한다. JRE Java Runtime Environment로 자바 애플리케이션을 생성하고 실행하기 위한 구성요소이다. JRE의 라이브러리를 통해 JVM 실행을 하는데 도움을 준다. JRE는 Java클래스 라이브러리, Java 클래스 로더 - 자바 클래스들은 한번에 로드 되지 않고, 필요 할 때 로드된다. 런타임에 클래스를 동적으로 JVM에 로드해 주는 일을 한다. 로 구성되어있다. JDK Java Development Kit 으로 말그대로 자바 어플리케이션을 구축하기 위한 개발 킷이다. 물론 JDK에는 JRE 를 포함하고 있기도하다. JDK에는 javac - java 파일을 class파일(바이트 코드가 ..
-
Set을 활용한 체크리스트 담기자바스크립트 코드 리뷰(자작) 2021. 12. 29. 00:48
고객의 요청으로 해당 글자를 클릭시 검색 옵션값으로 반영되어 재검색이 이루어지고 해당 옵션버튼의 X를 누를시 옵션을 제거할 수 있어야 한다는 요청을 받았다. 구조는 다음과 같다. Why Set? Set을 사용한이유는 각 검색 옵션이 중복될 수 없다는 조건이 있기때문에 굳이 내가 검색옵션을 조건문을 첨하여 일일히 계산을 늘릴 필요 없으므로 Set을 선택하게 되었다. callSet을 왜 생성하였는지는 다음 사진을 보면 알 수 있다. html 커스텀 속성을 이용하여 해당 html태그에 setname과 codevalue 속성을 부과하여 각각 검색 분류와 코드값을 넣어줬다. 그 값들을 이용하여 화면에 리페인팅을 해주는 함수를 호출 해주었고, 앞서 선언한 callSet을 이용하여 해당 set을 호출해 값을 집어넣어..