资源简介

设计模式_创建类_5种模式Java的实际例子_注释详细 包括 1、单例模式(Singleton) 2、工厂方法(Factory Method) 3、抽象工厂(Abstract Factory) 4、建造模式(Builder) 5、原型模式(Prototype)

资源截图

代码片段和文件信息

package com.demoFound.abstractFactory;

import com.demoFound.abstractFactory.factory.IMyMessageFactory;
import com.demoFound.abstractFactory.factory.MyMessageFactoryOnce;
import com.demoFound.abstractFactory.factory.MyMessageFactoryRepeated;
import com.demoFound.abstractFactory.message.IMyMessage;

/**
 * 工厂方法模式_消费者类
 * 
 * @author popkidorc
 * 
 */
public class MyAbstractFactoryMain {

public static void main(String[] args) {
IMyMessageFactory myMessageFactoryOnce = new MyMessageFactoryOnce();
IMyMessageFactory myMessageFactoryRepeated = new MyMessageFactoryRepeated();
IMyMessage myMessage;
// 对于这个消费者来说,不用知道如何生产message这个产品,耦合度降低
try {
// 先来一个短信通知_提醒
myMessage = myMessageFactoryOnce.createMessage(“SMS“);
myMessage.sendMesage();

// 来一个oa待办_提醒

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        983  2015-01-21 08:36  myDesignPatterns\.classpath

     文件       1199  2015-01-21 08:36  myDesignPatterns\.project

     文件        522  2015-01-21 08:36  myDesignPatterns\.settings\.jsdtscope

     文件        364  2015-01-21 08:36  myDesignPatterns\.settings\org.eclipse.jdt.core.prefs

     文件        507  2015-01-21 08:36  myDesignPatterns\.settings\org.eclipse.wst.common.component

     文件        414  2015-01-21 08:36  myDesignPatterns\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2015-01-21 08:36  myDesignPatterns\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2015-01-21 08:36  myDesignPatterns\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件        288  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\factory\IMyMessageFactory.java

     文件       1627  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\factory\MyMessageFactoryOnce.java

     文件       1652  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\factory\MyMessageFactoryRepeated.java

     文件        375  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\message\IMyMessage.java

     文件        621  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\message\MyAbstractMessageOnce.java

     文件        625  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\message\MyAbstractMessageRepeated.java

     文件        727  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\message\MyMessageEmailOnce.java

     文件        735  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\message\MyMessageEmailRepeated.java

     文件        750  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\message\MyMessageOaTodoOnce.java

     文件        758  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\message\MyMessageOaTodoRepeated.java

     文件        733  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\message\MyMessageSmsOnce.java

     文件        748  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\message\MyMessageSmsRepeated.java

     文件     191295  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\MyAbstractFactoryMain.cld

     文件       1576  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\abstractFactory\MyAbstractFactoryMain.java

     文件        654  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\builder\builder\IMyExceptionBuilder.java

     文件        911  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\builder\builder\MyExceptionCheckOutBuilder.java

     文件        900  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\builder\builder\MyExceptionFindEntityBuilder.java

     文件        498  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\builder\director\MyExceptionDirector.java

     文件        511  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\builder\exception\IMyException.java

     文件       1095  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\builder\exception\MyAbstractException.java

     文件        657  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\builder\exception\MyExceptionSimple.java

     文件     134994  2015-01-21 08:36  myDesignPatterns\src\com\demoFound\builder\MyBuilderMain.cld

............此处省略100个文件信息

评论

共有 条评论