设计模式实验4 抽象工厂模式资料.docVIP

  • 1
  • 0
  • 约8.84千字
  • 约 8页
  • 2019-10-10 发布于湖北
  • 举报
PAGE PAGE 7 实验报告 课程: 设计模式实验 学期: 2010-2011学年 第一学期 任课教师: 专业: 学号: 姓名: 成绩: 实验4 抽象工厂模式 1.题目: 使用抽象工厂模式实现一个DIY电脑店,其中的电脑配置有三个种类:学生版、家庭装、豪华版。 2.模式设计的UML类图: 3.程序源代码: (1)计算机配置工厂接口ComputerConfigurationFactory.java: public interface ComputerConfigurationFactory { public Cpu createCpu(); public Ram createRam(); public Mainboard createMainboard(); public Harddisk createHarddisk(); public Display createDisplay(); } (2)计算机配置工厂接口的各个子类: public class StudentComputerConfigurationFactory implements ComputerConfigurationFactory { publ

文档评论(0)

1亿VIP精品文档

相关文档