随笔分类 - JAVA_99_DesignMode
摘要:面向对象编程(Object-Oreinted Programming) 是一种编程范式。指在设计程序时大量运用类实例对象的方式。OOP一旦在项目中被运用,就成了时刻要考虑的东西。面向服务架构(Service-Oreinted Architecture) 是将软件设计成一组可互操作的服务的一套原则或方...
阅读全文
摘要:定义:Convert a interface of class into anthoer interface clients expect. Adapter let classes work together that could't otherwise because of incompat...
阅读全文
摘要:JDK 提供的动态代理的两个相关的类:InvocationHandler 和 Proxy 一:Proxy Proxy 提供了一个获取实例的静态方法 public static Object newProxyInstance(ClassLoader loader,Class<?>[] interfac
阅读全文
摘要:定义:provide a surrogate or palceholder for anthoer object to control access to it 提供一个代理或者另一个对象的占位符来控制对原本对象的访问类图: 分类:代理模式分为 普通代理、强制代理(访问该对象必须通过他...
阅读全文
摘要:定义: Define the skeleton of algorithm in an operation , deferring some steps to subclass. Template method lets subclasses redefine certain steps of a...
阅读全文
摘要:定义:Defined an interface for creating an object,but let subclasses decide which class to instantiate.Factory Method let a class defer instantiation to ...
阅读全文
摘要:package dmode.singleton;import java.util.Random;/** * 类描述: 单例模式 * 单例定义:ensure a class has only one instence,and provide a global point of access to i...
阅读全文
摘要:一:单一职责原则(single Responsibility Principle) 接口尽量做到职责的单一性,类可以灵活设计,通过实现不同的接口来达到目的二:里氏替换原则 父类出现的地方,子类都可以出现。增强代码健壮性,版本升级时,即使增加子类,原有子类不受影响。每一个子类是一个业务实体,通过父...
阅读全文
摘要:在UML类图中,常见的有以下几种关系:泛化(Generalization),实现(Realization),关联(Association),聚合(Aggregation),组合(Composition),依赖(Dependency)1.泛化(Generalization) 【泛化关系】:是一种继承...
阅读全文

浙公网安备 33010602011771号