Сообщения

Сообщения за сентябрь, 2023

Bean, Inversion of Control, Dependency Injection

 * Bean - object-dir. Spring terefinden idare oluna bilen bir object.  Bean scopes: singleton prototype request session application websocket Define Bean: 1) @Bean 2) stereotype annotation -> @Controller, @RestController,  @Service, @Repository, @Component * Inversion of Control: IoC Container package com.example.burhan_lesson_1.config ; import com.example.burhan_lesson_1.UserService ; import com.example.burhan_lesson_1.UserServiceImpl ; import org.springframework.context.annotation. Bean ; import org.springframework.context.annotation. Configuration ; @Configuration public class BeanConfig { @Bean public UserService userServiceImpl () { return new UserServiceImpl() ; } } Tutaq ki biz bu wekilde class yaratdiqda ve @Configuration iwletdikde o zaman IoC Containerde: UserService userService = UserServiceImpl(); bir object yaranir. * @Qualifier: eger bir interface-in birden cox implementasiyasi varsa biz bu annotation-u istifade ede bilerik. package com.example.burh

Entity lLifecycle

 

Interview Preparation

 A. Core Java 1. JVM daxilindeki esas yaddaw saheleri: a) Metaspace: static variables ve static primitive value, klass komponentleri(konstructor, method, field) b) Heap - Shared memory: instance variables, instance variable value, local reference variable values c) Stack - Per Thread: method signature, method parameter, method return type, local variables, local primitive variables value d) PC Register:  e) Native Method Stack: 2. JIT Compiler nedir? JVM-in icinde JIT Compiler var. Ve JIT Compiler Interpreterin iwini asanlawdirir. Kod tekrarlarini onceden detekt edib maswin koduna cevirir, ve bu zaman interpreter her kod tekrarinda yeniden interpretasiya etmeyecek.  3. Wrapper type-in dezavantajlari: a) Riyazi emeliyyatlarda elave olaraq unboxing emeliyyati baw verir, bu da cost-dur.  4. Primitiv tipin Wrapper type gore dezavantaji nedir? a) Primitiv tipleren default deyerler vardir amma Wrapper type-da default deyeri null-dur, Bu da data inconsistency (fileda deyer set etmediyimiz hal

ACID, @Transactional, Transaction isolation levels, L1 and L2 Cache, Redis

Изображение
ACID: Atomicity : Atomicity ensures that a transaction is treated as a single unit of work, which either completes entirely or fails entirely. There is no partial completion. For example, consider a bank transfer where money is withdrawn from one account and deposited into another. If the deposit fails, the withdrawal should be rolled back to maintain the atomicity of the transaction. Consistency : Consistency ensures that a transaction transforms the database from one consistent state to another consistent state. It guarantees that the integrity constraints, such as foreign key relationships or unique constraints, are not violated. For example, if a transaction increases a customer's balance, the new balance should reflect the correct amount after the transaction. Isolation : Isolation ensures that the concurrent execution of transactions produces a result that is equivalent to some serial execution of the transactions. This means that transactions are isolated from each other unt