抽象工厂模式(Abstract Factory)[3]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

实现AbstractProduct接口

ClientAnimalWorld

使用AbstractFactoryAbstractProduct

 

 

代码:

//AbstractFactory

public interface ContinentFactory{

            public Herbivore CreateHerbivore();

            public Carnivore CreateCarnivore();

}

 

 

//ConcreteFactory

public class AfricaFactory implements ContinentFactory{

            public Herbivore CreateHerbivore(){

本文关键:抽象工厂模式(Abstract Factory)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top