분류 전체보기
-
[CS] Design PatternComputer Science/CS 2024. 3. 20. 16:03
디자인 패턴 디자인 패턴은 개발하면서 발생하는 반복적인 문제들을 어떻게 해결할 것인지에 대한 해결방안으로 실제 현업에서 비즈니스 요구 사항을 프로그래밍으로 처리하면서 만들어진 다양한 해결책 중에서 많은 사람들이 인정한 모범 사례(Best Practive)다. 디자인 패턴의 장점 재사용성 : 반복적인 문제에 대한 일반적인 해결책을 제공하므로, 이를 재사용하여 유사한 상황에서 코드를 더 쉽게 작성할 수 있다. 가독성 : 일정한 구조로 정리하고 명확하게 작성하여 개발자가 코드를 이해하고 유지보수하기 쉽게 만든다. 유지보수성 : 코드를 쉽게 모듈화 할 수 있으며, 변경이 필요한 경우 해당 모듈만 수정하여 유지보수가 쉬워진다. 확장성 : 새로운 기능을 추가하거나 변경할 때 디자인 패턴을 활용하여 기존 코드를 변경..
-
[CS] 해시 충돌, Chaining, Open AddressingComputer Science/CS 2024. 3. 20. 14:35
해시 충돌을 알기 위해서는 - 해시 - 해시 테이블 - 해시 함수 을 알아야 하고, -해시 충돌 해소 기법에 대해서도 알아보자. 해시 Hash ● 임의의 크기를 가진 데이터(Key)를 고정된 크기의 데이터(Value)로 변화시켜 저장하는 것 ● 키에 대한 해시값을 사용하여 값을 저장하고 key-value쌍의 갯수에 따라 동적으로 크기가 증가하는 associate array이다. ● 키에 대한 해시값을 구하는 과정을 hashing(해싱)이라고 하며 이 때 사용하는 함수(알고리즘)을 해시함수라고 한다. ● 해시 값 자체를 index로 하기 때문에 평균 시간복잡도가 O(1)로 매우 빠르다. 해시 테이블 Hash Table, Tash Map Key와 Value를 갖는 자료구조, 주로 효율적인 검색에 활용. 해시..
-
[Java] Annotation, Reflection, Lombok, Spring BeanProgramming/Java 2024. 3. 14. 13:49
Annotation 어노테이션은 메타데이터(Metadata)라고도 불린다. ● 컴파일러에게 정보 알림 ● 컴파일할 때 설치(deployment)시의 작업을 지정 ● 실행할 때 별도의 처리가 필요 클래스, 메소드, 변수 등 모든 요소에 선언할 수 있다. 어노테이션은 상속이 안된다. 미리 만들어 놓은 어노테이션을 확장하는 것이 불가능하다. 어노테이션에 선언한 값을 확인하기 위해 Reflection을 사용한다. 리플랙션으로 클래스에 부여한 어노테이션 값을 취득할 수 있다. 기본 제공 3가지 JDK6까지는 미리 정해져 있는 어노테이션은 3개이다. 1. @Override 해당 메소드가 부모 클래스에 있는 메소드를 Override했다는 것을 명시적으로 선언. 제대로 Override했는지 확인하는 수단으로도 사용할 ..
-
[Java] Checked, Unchecked ExceptionProgramming/Java 2024. 3. 13. 16:03
자바 실행 시 발생할 수 있는 프로그램 오류를 Error와 Exception두가지로 구분한다. Error 시스템에 비정상적인 상황이 발생했을 경우 발생 메모리 부족(OutOfMemory Error), 스택오버플로우(StackOverflowError)와 같이 복구할 수 없는 것 Exception 프로그램 실행 중 개발자의 실수로 예기치 않은 상황이 발생 컴파일러가 에러처리를 확인하지 않는 RuntimeException클래스들은 unchecked 예외라고 하고, 예외처리를 확인하는 Exception 클래스들은 checked예외라고 한다. Checked Exception 반드시 에러 처리를 해야 한다(try-catch or thorw) Exception클래스의 하위 ● FileNotFoundException ..
-
[CS] SDK, APIComputer Science/CS 2024. 3. 3. 20:53
API Application Programming Interface 모듈화하여 만들어진, 어떤 기능을 제어/제공하는 인터페이스를 말한다. 어떤 서버의 특정한 부분에 접속해서 그 안에 있는 데이터와 서비스를 이용할 수 있게 해주는 소프트웨어 도구이다. API는 정의 및 프로토콜 집합을 사용하여 두 소프트웨어 구성 요소가 서로 통신할 수 있게 하는 매커니즘이다. 예를 들어, 기상청의 소프트웨어 시스템에는 일일 기상 데이터가 들어있다. 날씨 앱은 API를 통해 이 시스템과 통신하여 휴대폰에 매일 최신 날씨 정보를 표시한다. API라는 것은 결국은 앱의 페이로드를 처리하기 위해서 만들어진 것인데, ‘SOAP REST 차이’는 페이로드를 처리하는 방식에 있습니다. 페이로드는 인터넷을 통해서 전송되는 데이터입니다...
-
[CS] 가상메모리, 프로세스, 쓰레드, 멀티 프로세스, 멀티 쓰레드Computer Science/CS 2024. 3. 2. 20:43
가상메모리 Virtual Memory 메모리가 실제 메모리보다 많아 보이게 하는 기술로, 어떤 프로세스가 실행 될 때 메모리에 해당 프로세스 전체가 올라가지 않더라도 실행이 가능하다는 점에서 착안하여 고안되었다. ● 애플리케이션의 일부분만 메모리(기억장치)에 올려진다면, 메모리에 올라가지 않는 나머지는 어디에 위치할까? → 보조기억장치! 즉, 디스크! 가상 메모리의 핵심은 보조기억장치이다. ● 애플리케이션이 실행될 때, 실행에 필요한 일부분만 메모리에 올라가며 애플리케이션의 나머지는 디스크에 남게 된다. 즉, 디스크가 RAM의 보조기억장치(backing store)처럼 작동하는 것임. ● 결국, 빠르고 작은 기억장치(RAM)을 크고 느린 기억장치(디스크)와 병합하여, 하나의 크고 빠른 기억장치(가상메모리..
-
[CS] 컴퓨터 구성 요소Computer Science/CS 2024. 2. 29. 18:42
CPU, RAM, HDD, SSD, Cache Memory, NIC 주기억 장치(메인메모리) : RAM 보조기억 장치 : HDD, SSD HDD는 자기적 방식 SSD는 전기적 방식 CPU Central Processing Unit 중앙 처리 장치 연산 작업! 컴퓨터의 뇌, 컴퓨터의 다른 부품들과 신호를 주고 받으면서 시스템 전체를 제어하는 역할 CPU는 원래 한번에 하나의 작업만 처리할 수 있다(여러 프로그램 중 1개만 처리하는 것이라는 말이 아님) CPU가 하나여도 프로그램을 여러 개를 다룰 수 있다. 다만, 여러 프로그램에서 다수의 작업 요청이 들어오면 한 번에 처리하지 않고 하나씩 수행한다. CPU의 계산 속도가 워낙 빠르고 중요도에 따라 작업 순서를 정해서 처리하기 때문에 프로그램 여러 개를 실행..
-
[Java] OOME, JVM8 메모리Programming/Java 2024. 2. 29. 17:28
out of memory error 힙 메모리에서 발생하는 메모리 에러 OOME가 발생하는 시점은 대부분 개발이 완료된 후 사용자 테스트 및 인수 테스트 단계에서 많이 발생한다. 즉, 개발 단계에서 수행하는 단위 테스트의 경우 목적 기능에 대한 검중 위주로 진행되기 때문에 식별이 어렵고 가동 초기 단계 혹은 이와 유사한 테스트 환경에서 주로 발생하게 되는 것이다. OOME가 발생한 시점에 빠르게 대응해야 하는데 JVM Option을 통한 처리 방법과 Dump파일 분석을 통해 대응하게 된다. Java의 Reflaction기능을 이용하거나 Spring같은 프레임워크를 사용하는 경우 메모리를 고려하여 설계해야 한다. OOME 케이스 java.lang.OutOfMemoryError: Java Heap Space..