Programming

남궁성님의 Java의 정석(3rd Edition)을 보고 정리한 글입니다. 1. 조건문자바에서 조건문은 if, switch문 두 가지 뿐이다.if문은 위에서 아래로 순차적으로 조건식을 확인하는 반면, switch case 문은 해당되는 경우를 바로 찾아서 실행문을 실행시켜준다.switch-case는 정수, 문자, 문자열 형태만 가능하여, 정수로 값이 떨어지고 비교하려는 조건이 많아지면 swith-case를 사용하는 것이 성능면에서는 좋다.// if 문if(조건식1) { // 조건식1이 true일 때 실행} else if(조건식2) { // 조건식2이 true일 때 실행} else { // 위의 모든 조건식이 fasle 일 때 실행}// switch-case 문switch (ch) { case 'A..
남궁성님의 Java의 정석(3rd Edition)을 보고 정리한 글입니다.1. 변수(Variable)변수란 데이터를 저장할 수 있는 메모리 공간을 의미 변수를 메모리의 어디에 저장하고 어떤 방식으로 저장할지는 프로그래밍 언어와 운영체제가 정하는데, 자바의 경우 JVM이 하게 된다. 2. 명명 규칙대소문자가 구분된다.길이에 제한이 없다.예약어를 사용해서는 안된다.숫자로 시작해서 안 된다.특수문자는 “ _ ”, “ $ ” 만 사용 가능 3. 명명 규칙(권장사항)한글 등 사용 x (오류 잡기가 힘듦)클래스 이름의 첫 글자는 항상 대문자Person, String변수, 메서드 이름은 항상 소문자getInfo(), age여러 단어의 경우 첫글자는 대문자lastIndexOf(), StringBuilder상수는 대문자..
1. 개요The dependencies of some of the beans in the application context form a cycle:┌─────┐| principalOauth2UserService (field private org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder com.cos.security1.config.outh.PrincipalOauth2UserService.bCryptPasswordEncoder)↑ ↓| securityConfig defined in file [E:\\Project\\SpringWebStudy\\security1\\out\\production\\classes\\com\\cos\\s..
1. Elastcisearch 설치 및 실행Elastcisearch 7.17.12 버전 설치현재 8.x 버전까지 나와있는데 라이브러리, 보안 설정 등 변경된 부분이 많아 7.17..2 버전을 사용했다.https://www.elastic.co/kr/downloads/elasticsearch Download ElasticsearchDownload Elasticsearch or the complete Elastic Stack (formerly ELK stack) for free and start searching and analyzing in minutes with Elastic.www.elastic.co Elastisearch 실행path\bin\elasticsearch.bat 로컬환경에서 실행했다면 htt..
1. Kafka 설치 및 실행a. Kafka 설치아래의 링크에서 Kafka 2.8.2 를 설치했다.https://kafka.apache.org/downloads Apache KafkaApache Kafka: A Distributed Streaming Platform.kafka.apache.org b. Zookeeper 실행Kafka는 Zookeeper를 내부적으로 사용한다. Kafka를 실행하기 전에 아래 명령어로 Zookeeper를 먼저 실행시키도록 하자.path\bin\windows\zookeeper-server-start.bat config\zookeeper.properties c. Kafka 실행아래 명령어로 Kafka를 실행시키자.path\bin\windows\kafka-server-start..
1. 로컬 환경에 PostgreSQL 설치https://www.postgresql.org/ PostgreSQLThe world's most advanced open source database.www.postgresql.org  2. Spring Boot, JPA, PostgreSqla. 의존성 추가implementation 'org.springframework.boot:spring-boot-starter-data-jpa'runtimeOnly 'org.postgresql:postgresql'Spring Data JPA, PostgreSQL Driver 추가 b. application.ymlspring: datasource: driver-class-name: o..
Spring Boot로 Redis 간단한 CRUD를 예제를 해보겠다.1. Redis 설치아래 링크에서 Redis를 설치하면 된다! 로컬환경에 설치를 진행했다.https://github.com/microsoftarchive/redis/releases Releases · microsoftarchive/redisRedis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes - microsoftarchive/redisgithub.com  2. Spring  Boot ..
1. MQTT Broker 설치실습에 앞서 먼저 MQTT Broker를 설치해야 한다. 간단한 예제를 하기 때문에 로컬환경에 설치했다.MQTT Broker 중 Mosquitto를 설치하여 사용하였고, 아래 링크로 접속해서 설치를 진행했다. window일 경우 아래 사진을 참고해서 설치하면 된다.https://mosquitto.org/download/ DownloadSource mosquitto-2.0.17.tar.gz (GPG signature) Git source code repository (github.com) Older downloads are available at https://mosquitto.org/files/ Binary Installation The binary packages list..
김영한님의 Spring 핵심원리 강의를 듣고 정리하는 글입니다.1. 개요데이터베이스 커넥션 풀이나, 네트워크 소켓처럼 애플리케이션 시작 시점에 필요한 연결을 미리 해두고, 애플리케이션 종료 시점에 연결을 모두 종료한 작업일 경우, 객체의 초기화와 종료 작업이 필요하다. 네트워크 연결하는 동작을 표현한 예제 코드를 통해 설명해보겠다.public class NetworkClient { private String url; public NetworkClient() { System.out.println("생성자 호출 , url=" + url); connect(); call("초기화 연결 메세지"); } public void call(String msg) ..
김영한님의 Spring 핵심원리 강의를 듣고 정리하는 글입니다.1. 서론컴포넌트 스캔과 의존관계를 자동으로 주입받게 되는 과정에 대해서 다루었던 적이 있다. 이 포스팅에서는 의존관계를 주입하는 4가지 방법들에 대해서 다루겠다. 2. 의존관계 자동주입 방법 4가지생성자 주입setter 주입필드 주입일반 메서드 주입 의존관계를 주입하는 방법에는 4가지가 있다. 하나씩 예제를 통해서 정리해보자.의존관계를 주입할 때 기본적으로 @Autowired 어노테이션을 사용한다. 참고로 @Autowired는 빈을 찾아서 주입하게 되는데 주입할 대상이 없을 경우 에러가 발생한다. 주입할 대상이 없더라도 동작하게 하려면 @Autowired(required = false)로 지정하면 된다.a. 생성자 주입@Componentpu..
kmindev
'Programming' 카테고리의 글 목록 (8 Page)