전체 글
-
[Spring] java.time.format.DateTimeParseException: Text '2024-05-25 14:33:07.049436' could not be parsed at index 10legacy/Spring 2024. 7. 9. 23:55
RedisRedis에서는 마지막으로 알림이 조회된 시간을 저장한다.hget Notification:notification lastNotificationTime"2024-07-09T23:39:39.101337"@Getter@RedisHash("Notification")@AllArgsConstructor(access = AccessLevel.PRIVATE)public class NotificationRedis { @Id private String notification; // key private LocalDateTime lastNotificationTime; // value public static NotificationRedis of(String notification, LocalD..
-
[네트워크] HTTP와 HTTPSlegacy/Network 2024. 7. 7. 21:08
1. HTTP1-1. HTTP란?HTTP란 Hyper Text Transfer Protocol의 약자로써, 서버/클라이언트 모델에서 데이터를 주고받기 위한 프로토콜이다. HTTP는 80 포트를 사용하며 클라이언트로부터 요청이 오기를 기다린다. 1-2. HTTP 구조GET /index.html HTTP/1.1Host: www.example.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q..
-
[Kotlin] sealed classlegacy/Kotlin 2024. 7. 5. 16:40
1. 등장 배경부모 클래스가 있고 자식 클래스가 3개가 존재할 때, 컴파일러 입장에서는 부모 클래스를 상속하는 클래스가 몇 개인지 알 수 없다. 1-1. 부모 클래스open class Car( val name: String, val color: String) { internal fun carInfo() { println("차의 종류는 ${name}이며 색깔은 ${color}입니다.") }} 1-2. 자식 클래스class Honda( name: String, color: String) : Car(name = name, color = color)class Hyundai( name: String, color: String) : Car(name = name..
-
[Kotlin] Accessing non-final property number in constructorlegacy/Kotlin 2024. 7. 5. 14:36
1. 상위 클래스open class Base( open val number: Int = 100) { init { println("Base Class") println("Base Class number ${number}") }} 2. 상위 클래스를 상속받는 하위 클래스class Derived( override val number: Int): Base(number) { init { println("Derived Class") println("Derived Class number : ${number}") }} 3. 하위 클래스를 인스턴스화하기fun main() { val derived = Derived(1)} 4. 의도와..
-
[운영체제] 외부 단편화와 내부 단편화legacy/Operating System 2024. 7. 4. 15:38
1. 외부 단편화란?외부 단편화란 남아 있는 총 메모리 공간이 요청 메모리 공간보다 크지만, 남아 있는 메모리 공간이 연속적으로 위치하지 않아 요청한 메모리를 적재할 수 없는 현상이다. 아래 예시를 보자.남아 있는 총 메모리 공간 : 100MB (50 + 50)요청 메모리 크기 : 80MB총 메모리 공간만 보았을 때 충분히 요청 메모리를 적재할 수 있으나, 남아있는 두 메모리가 연속적으로 위치하지 않아 적재할 수 없다. 1-1. 외부 단편화가 발생하는 이유총 메모리 공간은 충분함에도 남아 있는 메모리들이 연속적으로 위치하지 않기 때문이다. 2. 외부 단편화 해결하기외부 단편화가 발생한 이유는 남아있는 메모리가 연속적으로 위치하지 않았기 때문이다. 그렇다면 남아 있는 메모리를 연속적으로 위치할 수 있도록..
-
[Spring] 생성자 주입(constructor injection)을 사용하는 이유legacy/Spring 2024. 7. 3. 14:49
1. 생성자 주입이란?생성자 주입 방법은 객체를 생성하기 위해 생성자를 호출하는 시점 1회에만 호출되는 것을 보장한다.@Servicepublic class UserService { private UserRepository userRepository; @Autowired public UserService(UserRepository userRepository) { this.userRepository = userRepository; }} 스프링 프레임워크는 생성자 주입을 적극적으로 지원하고 있기 때문에 아래와 같이 생성자가 1개만 존재하는 경우에는 @Autowired 사용 없이 주입이 가능하다.@Servicepublic class UserService { private ..