공부하고 기록하는, 경제학과 출신 개발자의 노트
반응형

학습일지 206

Java8 Stream - Optional - Date 정리

인프런 '더 자바- 자바8' 백기선님 강의내용 정리 Stream 정의: 연속된 데이터를 처리하는 Operation 모음. Collection이 데이터를 모아놓은 자료구조라면, Stream은 이걸 토대로 데이터를 원하는 방식으로 처리하는 것. 따라서 데이터 저장소의 개념이 아니다. 특징 Function in Nature. 원본 데이터를 변경하지 않는다. Stream stringStream = names.stream().map(String::toUpperCase); Stream으로 어떤 연산을 수행한 결과는 stream 객체이고, 원본은 바뀌지 않는다. 스트림으로 들어온 데이터는 한 번만 처리 (반복문 개념이 아님) seamless하게 들어오는 데이터 처리 가능. (무제한으로 데이터가 들어오면, 무한히 처리..

Java Reflection 정리

인프런 '더 자바 - 코드를 조작하는 다양한 방법' 백기선님 강의내용 정리 Reflection 코드를 조작하는 다양한 방법 중 하나. 정의된 클래스 / 메소드 / annotation 정보를 확인하고 참조하기 인스턴스를 생성하고, 필드값을 변경하며, 메소드를 실행할 수 있는 방법. 스프링부트 프로젝트 생성. dependency에 스프링 웹 추가. BookService와 BookRepository라는 두 개의 컴포넌트를 생성하고, BookService에 Autowired로 BookRepository를 추가한 뒤 BookServiceTest 코드를 아래처럼 작성한다. package com.inspirit941.thejavaspringreflection; import org.junit.jupite..

Java Concurrent Programming - Executors, Callable, Future, CompletableFuture

백기선님의 인프런 더 자바8 강의 내용 정리. Concurrent Programming 이전까지의 자바 Concurrent Programming을 알아야 한다. 자바의 기본 Concurrent Programming Concurrent 소프트웨어 동시에 여러 작업을 할 수 있는 SW 자바에서는 멀티프로세싱, 멀티쓰레드 둘 다 가능하다. 이 중 멀티쓰레드를 다룸. package com.inspirit941.java8to11; public class testConcurrentProgramming { static class MyThead extends Thread { @Override public void run() { System.out.println("Thread: " + Thread.currentThrea..

Java 함수형 인터페이스 - Lambda 표현식 - 메소드 레퍼런스 정리

함수형 인터페이스 추상 메소드가 하나만 있는 인터페이스 자바8에서부터 @FunctionalInterface Annotation을 지원. static과 default로 선언하고 구현한 함수는 '추상 메소드'가 아니므로 괜찮다. 함수형 프로그래밍을 하기 위해서는 해당 언어에서 함수(메소드)가 First Class Object여야 한다. 해당 함수는 Pure Function이어야 한다. 는 전제조건이 필요하고, 자바는 함수를 First Class Object로 취급하므로 프로그램 언어의 제약은 없다. cf. 함수형 인터페이스와 lambda는 자바에서 지원하는 문법일 뿐, 함수형 프로그래밍을 강제하는 게 아니다. First Class Object? 아래의 조건을 만족하는 객체를 First Class Object..

JVM의 ClassLoader 정리

JVM 구조 JVM은 다섯 가지 컴포넌트로 구성되어 있다. 클래스 로더 시스템 : 컴파일 결과로 만들어진 .class 바이트코드 파일을 읽어들여 메모리에 배치. 로딩, 링크, 초기화 세 가지 과정을 거친다. 메모리 Runtime Engine: 바이트코드를 읽어들이는 인터프리터가 작동하는 영역. 바이트 코드를 기계어로 변환하면서 Line by Line 실행하는 방식. 여기 인터프리터가 기계어 코드를 실행할 때, 한 번 변환한 바이트코드를 또 변환하는 대신 실행한 코드를 저장하는 영역이 있다. 그게 Code Cache (JIT Compiler라고도 부른다). 프로그램 실행속도를 향상시키는 용도. Garbage collection. Native Method interface Native Method libra..

JVM Garbage Collection 정리

Garbage Collection (JDK 11 기준) Application의 동적 메모리 관리를 자동으로 수행하는 JVM 프로그램을 의미한다. Garbage는 "실행중인 프로그램의 어느 포인터로도 접근할 수 없는 객체"를 지칭한다. GC는 기본적으로 아래 네 단계를 거쳐 작업을 수행한다. 운영체제로부터 메모리를 할당받거나 반납한다. 메모리를 요청하는 프로르램에게 메모리를 할당한다. 애플리케이션이 사용하고 있는 / 사용하고 있지 않는 메모리 영역을 파악한다. 사용하지 않는 메모리 영역을 회수한다. 프로그래머가 메모리 관리를 직접 할 필요가 없다는 점에서 유용하고, 프로그래머가 메모리 관련해서 전혀 신경쓰지 않아도 자바 프로그램이 문제 없이 동작하는 경우도 많다. 하지만 프로그램의 규모가 커질 경우 "어떤..

JVM의 메모리 구조 및 할당과정

JVM 구조 JVM은 다섯 가지 컴포넌트로 구성되어 있다. 클래스 로더 시스템 : 컴파일 결과로 만들어진 .class 바이트코드 파일을 읽어들여 메모리에 배치. 로딩, 링크, 초기화 세 가지 과정을 거친다. 메모리 Runtime Engine: 바이트코드를 읽어들이는 인터프리터가 작동하는 영역. 바이트 코드를 기계어로 변환하면서 Line by Line 실행하는 방식. 여기 인터프리터가 기계어 코드를 실행할 때, 한 번 변환한 바이트코드를 또 변환하는 대신 실행한 코드를 저장하는 영역이 있다. 그게 Code Cache (JIT Compiler라고도 부른다). 프로그램 실행속도를 향상시키는 용도. Garbage collection. Native Method interface Native Method libra..

Architecting with Google Compute Engine - Design Process ch1. Defining Service

Design and Process 실제로 How to start, utilize a design and process the follows the best practices. 강의 구성 Lecture, introducing architect concepts and principles. Application of those principles to a real world design Related application problem. Compare it with standard solutions Lecture 1. Defining the Service Overview Automated Deployments are the foundation of SRE and design process. 강의보다는 lab ..

[IBM Cloud 강의번역 프로젝트] - ch3-5. Service Binding

IBM Cloud 1기 활동 - 강의번역 프로젝트. 원본 강의 cognitiveclass.ai/courses/kubernetes-course Kubernetes and containers on IBM Cloud - Free Kubernetes course by IBM Cognitive Class About this course Containers and Cloud Native are the most significant invention in IT since the introduction of virtualization. Everyone from a small startup to a large multinational corporation is transitioning to this technology ..

[IBM Cloud 강의번역 프로젝트] - ch3-4. ConfigMaps and Secrets

IBM Cloud 1기 활동 - 강의번역 프로젝트. 원본 강의 cognitiveclass.ai/courses/kubernetes-course Kubernetes and containers on IBM Cloud - Free Kubernetes course by IBM Cognitive Class About this course Containers and Cloud Native are the most significant invention in IT since the introduction of virtualization. Everyone from a small startup to a large multinational corporation is transitioning to this technology ..

반응형