전체 글 194

추상화 (Abstraction)

추상화(Abstraction) 컴퓨터 과학에서 추상화(abstraction)는 복잡한 자료, 모듈, 시스템 등으로부터 핵심적인 개념 또는 기능을 간추려 내는 것을 말한다. - https://ko.wikipedia.org/wiki/추상화_(컴퓨터_과학) 추상화가 중요한 이유 인간이 단기로 기억할 수 있는 아이템의 개수은 7개이다 - 밀러의 매직 넘버 7 전체 시스템을 전부를 다 기억을 할수 있는 사람은 거의 없다 (있을수도) 전체를 기억을 못해도 나무 대신 숲을 알고 있으면 개발을 할때 큰 문제가 없다. 추상화 예제 자바의 Interface / Abstract class 자바에서 interface 또는 Abstract class를 활용하여 내부 작동을 몰라도 사용할수 있도록 개발을 할수 있다. 객체지향개발..

Programing 2020.09.22

Spring Batch - Parallel Processing

시작하기 전에 Spring Batch를 통해 배치 서비스를 개발을 할때 성능이 극대화할 필요가 있을수가 있다. Thread을 이용하여 Parallel Processing을 하는 방법에 대해 알아보자. Multi-threaded step @Bean public TaskExecutor taskExecutor(){ return new SimpleAsyncTaskExecutor("spring_batch"); } @Bean public Step sampleStep(TaskExecutor taskExecutor) { return this.stepBuilderFactory.get("sampleStep") .chunk(10) .reader(itemReader()) .writer(itemWriter()) .taskExe..

Spring Framework - Bean Scope

Singleton 스프링 컨테이너에 관리되는 빈의 기본 Scope 스프링 컨테이너에서 단 하나의 객체만 존재를 한다. Prototype Singleton 가 다르게 다수의 객체가 존재를 할수 있다. 스프링 컨테이너에서 Bean의 Life Cycle를 전부 관리를 하지 않는다. 즉 사용 Reference가 없는 GC에 의해 객체가 정리가 된다. Lifecylce에 의해 정의되는 종료 메서드가 호출이 되지 않는다. (@Predestory 등) Request Http Request 생명주기 안에 유효한 Bean, 즉 Web-aware Spring Application Context에서 유효하다. Session Http Session 생명주기 안에 유요한 Bean, Request와 동일하게 Web-aware A..

Spring Framework, IoC, DI

Spring Framework 엔터프라이즈급 애플리케이션을 만들기 위한 경량솔루션이며 많은 기능을 제공하며 자바 애플리케이션 개발을 위한 포괄적인 인프라스트럭쳐를 제공하는 자바 플랫폼이다. 스프링은 당신이 애플리케이션에 집중할 수 있도록 인프라스트럭쳐를 제공한다. IoC (Inversion of Control) - 제어의 역전 개발자가 객체 생성을 직접하지 않고 컨테이너 (Container)에서 객체 생성/소멸 등을 관리하는 방식 개발자가 직접 컨트롤 할 수 없고, 컨테이너가 (Container)관리를 하기 때문에 제어의 역전(Inversion of control)이라고 표현함. Spring에서 IoC Container인 ApplicationContext에서는 bean xml 또는 annotation을 ..

Java Blog Index

Java Blog Index기본Minor gc/Major gc/ Full gc [https://helloino.tistory.com/7]GC overhead limit exceeded [https://helloino.tistory.com/97]제너릭 [https://helloino.tistory.com/101]CompletableFuture [https://helloino.tistory.com/132]Executor Service [https://helloino.tistory.com/117]객체지향개발절차지향 프로그래밍과 객체지향 프로그래밍 [https://helloino.tistory.com/179?category=699621]SOLID 개발 원칙 [https://helloino.tistory.com/..

목차 2019.03.03

JdbcTemplate, RowCallbackHandler 이용하기

JdbcTemplate, RowCallbackHandler 이용하기리턴되는 결과값이 사이즈가 큰 경우에는 직접 ResultSet를 받아서 사용할수가 있다.ex) Hive에 리턴되는 값을 처리하는 프로세스 public class RowCallbackHandlerImpl implements RowCallbackHandler { public void processRow(ResultSet rs) throws SQLException { // do something with resultset }} jdbcTemplate.query(sql, values, new RowCallbackHandlerImpl);

MySQL Null Condition

MySQL Null Condition # Wrong Condition select * from table where column = null select * from table where column != null # Correct Conditionselect * from table where column is nullselect * from table where column is not null # null이거나, 특정값이 아닌 경우## Wrong, VALUE가 아닌경우의 검색 조건, 하지만 null일때의 데이터값을 가지고 올수가 없다.select * from table where column != 'VALUE' ## Correctselect * from table where (column != 'VA..

Database/MySQL 2019.01.23