手把手教你寫SprintBoot框架

1 · Hoxton · April 1, 2023, 1:47 p.m.
前言 連假實在有點無聊,打算來手寫一個SprintBoot專案,來加深自己對這種IoC框架的理解,我打算把這個框架叫做Winter,象徵我每況愈下的人生,唉 SprintBoot 單例池 本章所用到的程式碼存放在這 https://github.com/Hoxton019030/Winter/tree/bean-scan-and-beandefinition 一切開始的地方,Main 啟動類的寫法如下 1 2 3 4 5 public class Main { public static void main(String[] args) { WinterApplicationContext applicationContext = new WinterApplicationContext(AppConfig.class); } } 這邊看到兩個陌生的Class,WinterApplicationContext,以及AppConfig。先講AppConfig是什麼,它是Winter的配置類,我們會在這邊去配置我們Winter Bean的位置在哪邊,所以我們要加上@Compon...