IOC控制反轉

接口 能夠提供不一樣的子類實現,增長代碼穩定和健壯性等等,可是接口必定是須要實現的,也就是以下語句早晚要執行:編程  AInterface a = new AInterfaceImp(); 這樣一來,耦合關係就產生了,如:spa Class A {          AInterface a;           void aMethod() { a = new AInterfaceImp();
相關文章
相關標籤/搜索