status
date
slug
tags
category
type
password
icon
Environment
- OS: Windows 10
- IntelliJ IDEA: 2024.2
- java: 1.8.0_202
- javassist: 3.12.1-GA
Studying
Note
- Reflection
- Java 在 runtime 時,可以動態操作 Class 的方法 (e.g. 載入、檢視、生成物件、操作物件)
- Bean
- 符合以下規範的 Java Class
- getter:
public Type getXyz()
- setter:
public void setXyz(Type val)
- 將一組對應的 getter 與 setter function 稱作 propetry
- IoC
- Inverse of Control
- 盡量避免由模組創建新物件,而是由 IoC 容器統一負責新物件的創立,再由模組內的 set function 傳遞給模組,稱為依賴注入(DI, Dependency Injection)
- e.g. 許多模組對於 db 的操作,每個模組自己創建 db 物件 → 統一跟 IoC 容器要,對於 db 配置、連線等等操作只須執行一次。
Implementation
Takeaway
Problem
Code
- Author:Zixu
- URL:https://zixu.us.kg/article/Spring_入門課
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!