• 大小: 0.74M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-27
  • 语言: Java
  • 标签: 设计模式  java  javaee  

资源简介

什么是设计模式?
设计模式就是在工作中经常遇到的一类问题的解决方案,是一种解决问题的方法,更是一种思想,是智慧的结晶。
设计模式是对被用来在特定场景下解决一般设计问题的类和相互通信的对象的描述。

资源截图

代码片段和文件信息

package dps_01_build_type.dp01_singleton.eager.example1;

/**
 * 饿汉式单例(唯一角色即类本身):

 * 在类被加载的时候,唯一实例已经被创建。这个设计模式在Java中容易实现,在别的语言中难以实现。

 * @author Administrator
 */
public class EagerSingleton {

  /**私有的(private)唯一(static final)实例成员在类加载的时候就创建好了单例对象*/
  private static final EagerSingleton instance = new EagerSingleton();

  /**
   * 私有构造函数避免从外部创建实例
   */
  private EagerSingleton() {
  }

  /**
   * 静态工厂方法返回此类的唯一实例.

   * @return EagerSingleton      
   */
  public static EagerSingleton getInstance() {
    return instance;
  }

}

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

    .CA....       414  2009-06-15 01:09  DesignPattern\.classpath

    .CA....       312  2009-08-09 21:39  DesignPattern\.mymetadata

    .CA....        66  2009-08-06 12:25  DesignPattern\.myumldata

    .CA....      1015  2009-06-14 22:52  DesignPattern\.project

    .CA....       629  2009-08-07 09:12  DesignPattern\.settings\org.eclipse.jdt.core.prefs

    .CA....        99  2009-08-07 09:11  DesignPattern\.settings\org.eclipse.jdt.ui.prefs

    .CA....       682  2009-08-11 13:15  DesignPattern\src\dps_01_build_type\dp01_singleton\eager\example1\EagerSingleton.java

    .CA....       601  2009-08-11 12:29  DesignPattern\src\dps_01_build_type\dp01_singleton\eager\example1\Test.java

    .CA....       756  2009-08-11 13:15  DesignPattern\src\dps_01_build_type\dp01_singleton\lazy\example1\LazySingleton.java

    .CA....       594  2009-08-11 12:29  DesignPattern\src\dps_01_build_type\dp01_singleton\lazy\example1\Test.java

    .CA....       722  2009-08-11 11:44  DesignPattern\src\dps_01_build_type\dp01_singleton\readme.txt

    .CA....      1899  2009-08-11 13:28  DesignPattern\src\dps_01_build_type\dp01_singleton\register\example1\RegisterSingleton.java

    .CA....       697  2009-08-11 13:21  DesignPattern\src\dps_01_build_type\dp01_singleton\register\example1\RegisterSingletonChild.java

    .CA....      1141  2009-08-11 12:26  DesignPattern\src\dps_01_build_type\dp01_singleton\register\example1\Test.java

    .CA....       939  2009-08-10 17:40  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\concrete_creator\AccessFactory.java

    .CA....       960  2009-08-10 17:40  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\concrete_creator\SqlServerFactory.java

    .CA....       759  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\concrete_product\AccessDeptDAO.java

    .CA....       759  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\concrete_product\AccessUserDAO.java

    .CA....       773  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\concrete_product\SqlServerDeptDAO.java

    .CA....       773  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\concrete_product\SqlServerUserDAO.java

    .CA....       545  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\creator\Factory.java

    .CA....       739  2009-08-10 17:40  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\model\Dept.java

    .CA....       737  2009-08-10 17:40  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\model\User.java

    .CA....       467  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\product\DeptDAO.java

    .CA....       467  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\product\UserDAO.java

    .CA....      1221  2009-08-10 17:40  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example1\Test.java

    .CA....      1243  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example2\concrete_creator\DAOFactory.java

    .CA....       759  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example2\concrete_product\AccessDeptDAO.java

    .CA....       759  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example2\concrete_product\AccessUserDAO.java

    .CA....       773  2009-08-10 17:39  DesignPattern\src\dps_01_build_type\dp02_factory\abstract_factory\example2\concrete_product\SqlServerDeptDAO.java

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

评论

共有 条评论