X Spring
Last updated
Was this helpful?
Last updated
Was this helpful?
攔截器 Interceptor。
事務管理 Transactional。
紀錄 Logging。
安全驗證 Security。
Spring AOP 基於 動態代理 實現。
AspectJ 基於 靜態代理 實現。
基於XML的配置
基於註釋的配置(主要)
基於Java的配置(主要)
A 依賴注入於 B,B 依賴注入於 C ,C 依賴注入於 A。
重新設計。
透過 @Lazy 延遲加載。
不透過 建構子注入,而是透過 setter 注入。
使用 @PostConstruct 階段,注入依賴的對象。
其中一個實作 ApplicationContextAware 和 InitializingBean, 讓其可以讀取 context,取得已經完成的另一個bean 。
Proxy 代理 –在AOP和遠程處理中大量使用。
Singleton 單例 – Spring bean默認為單例。
模板方法 -廣泛地用來對付模板重複代碼,如: RestTemplate,JpaTemplate。
Front Controller – Spring 提供 DispatcherServlet 以確保傳入的請求被調度到控制器。
View Helper – Spring具有許多視圖技術 ( JSP、thymeleaf ),以幫助將代碼與 View 分離。
依賴注入 –以整體 BeanFactory / ApplicationContext 概念為中心的 IOC 容器。
工廠模式 –用於創建對象實例的 BeanFactory。