Spring Boot

Spring Core - IoC & DI

Inversion of Control, Dependency Injection, annotation (@Component, @Autowired, @Bean), scope, วงจรชีวิตของ bean

22 คำถามสัมภาษณ์·
Junior
1

Inversion of Control (IoC) ใน Spring คืออะไร?

คำตอบ

IoC คือหลักการที่ Spring framework จัดการการสร้างและวงจรชีวิตของอ็อบเจกต์แทนนักพัฒนา ซึ่งกลับด้านการควบคุมแบบดั้งเดิมที่โค้ดแอปพลิเคชันสร้างอินสแตนซ์ของ dependency โดยตรง Spring ใช้ IoC container เพื่อจัดการ bean และ dependency ของมันแบบ declarative

2

bean ใน Spring คืออะไร?

คำตอบ

bean คืออ็อบเจกต์ที่ถูกจัดการโดย Spring IoC container โดย Spring จะสร้างอินสแตนซ์ กำหนดค่า และประกอบมันตามเมตาดาตาการตั้งค่า (annotation, XML หรือ Java config) bean เป็นหัวใจของแอปพลิเคชัน Spring และได้รับประโยชน์จาก dependency injection

3

annotation @Component มีจุดประสงค์อะไร?

คำตอบ

annotation @Component ทำเครื่องหมายคลาสว่าเป็น Spring bean ที่จะถูกตรวจพบโดยอัตโนมัติระหว่าง component scanning ที่เปิดใช้งานโดย @ComponentScan Spring จะสร้างอินสแตนซ์ของคลาสนี้และวางไว้ใน IoC container ด้วยชื่อเริ่มต้น (ชื่อคลาสแบบ camelCase) นี่คือ annotation stereotype ทั่วไปที่ @Service, @Repository และ @Controller สืบทอดมาเพื่อให้ความหมายทางธุรกิจที่เฉพาะเจาะจง

4

dependency injection ใน Spring มีสามประเภทอะไรบ้าง?

5

annotation @Autowired ทำงานอย่างไร?

+19 คำถามสัมภาษณ์

หัวข้อสัมภาษณ์ Spring Boot อื่นๆ

Spring Boot Auto-Configuration

Junior
20 คำถาม

Spring Boot Starters

Junior
18 คำถาม

Application Properties & YAML

Junior
16 คำถาม

การทำ Logging ด้วย SLF4J และ Logback

Junior
20 คำถาม

Spring Boot DevTools

Junior
15 คำถาม

Spring MVC Basics

Mid-Level
20 คำถาม

Spring REST Controllers

Mid-Level
20 คำถาม

Request & Response Handling

Mid-Level
20 คำถาม

การจัดการข้อยกเว้น

Mid-Level
25 คำถาม

Bean Validation

Mid-Level
25 คำถาม

พื้นฐาน Spring Data JPA

Mid-Level
25 คำถาม

เอนทิตี JPA และความสัมพันธ์

Mid-Level
30 คำถาม

การสืบค้น JPA

Mid-Level
30 คำถาม

Spring Data Repositories

Mid-Level
25 คำถาม

พื้นฐาน Spring Security

Mid-Level
25 คำถาม

Spring Boot Actuator

Mid-Level
20 คำถาม

การทดสอบหน่วยด้วย JUnit และ Mockito

Mid-Level
30 คำถาม

การทดสอบ Spring Boot

Mid-Level
30 คำถาม

Profiles และ Environment

Mid-Level
20 คำถาม

RestTemplate และ WebClient

Mid-Level
24 คำถาม

Async และ Scheduling

Mid-Level
25 คำถาม

Caching ด้วย Spring

Mid-Level
25 คำถาม

Spring WebFlux (Reactive)

Mid-Level
25 คำถาม

ทรานแซกชัน Spring

Senior
30 คำถาม

การยืนยันตัวตนและการให้สิทธิ์ขั้นสูง

Senior
30 คำถาม

JWT และความปลอดภัยแบบ Stateless

Senior
20 คำถาม

OAuth2 และ Authorization Server

Senior
20 คำถาม

Spring Boot และ Docker

Senior
19 คำถาม

Microservices ด้วย Spring

Senior
25 คำถาม

Spring Cloud Config

Senior
19 คำถาม

การเพิ่มประสิทธิภาพการทำงาน

Senior
30 คำถาม

GraalVM Native Images

Senior
20 คำถาม

เชี่ยวชาญ Spring Boot สำหรับการสัมภาษณ์ครั้งถัดไป

เข้าถึงคำถามทั้งหมด flashcards แบบทดสอบเทคนิค แบบฝึกหัด code review และตัวจำลองสัมภาษณ์

เริ่มใช้ฟรี