提供一个接口,用于创建相关的对象家族。具体工厂类可以创建多个“大类”对象,但是若增加产品类型还是需要修改抽象工厂和具体工厂,违反开闭原则。
1 | package cn.xiaohupao.abstractfactory; |
1 | package cn.xiaohupao.abstractfactory; |
1 | package cn.xiaohupao.abstractfactory; |
1 | package cn.xiaohupao.abstractfactory; |
1 | package cn.xiaohupao.abstractfactory; |
1 | package cn.xiaohupao.abstractfactory; |
1 | package cn.xiaohupao.abstractfactory; |
1 | package cn.xiaohupao.abstractfactory; |
1 | package cn.xiaohupao.abstractfactory; |