4.Abstract Factory(抽象工厂)
作用:创建某一种类的对象
JDK中体现:
(1)java.sql包
(2)UIManager(swing外观)
类图:
package ttyouni.factory; //抽象工厂 public interface AbstractFactory { public Button newButton(); public Text newText(); } interface Button { } class WindowsButton implements Button { } class UnixButton implements Button { } interface Text { } class WindowsText implements Text { } class UnixText implements Text { }