model of design
小小冷菜鸟
这个作者很懒,什么都没留下…
展开
-
observe
package observe; public class Boss { private int status = 1;//0为老板出去,1为老板进来 public int getStatus() { return status; } public void setStatus(int status) { this.status = sta...2012-04-13 17:51:04 · 157 阅读 · 0 评论 -
templet
package templet; public abstract class Tour { public abstract float fare(); public abstract float lunch(); public abstract float ticket(); public void result() { float sum = fare() +...2012-04-11 17:46:05 · 123 阅读 · 0 评论 -
strategy
package strategy; //一个追女孩子的策略 public interface Strategy { public void doSometing(); } package strategy; public class StrategyOne implements Strategy { public void doSometing() ...2012-04-11 17:44:02 · 95 阅读 · 0 评论 -
prototype
package prototype; public class GirlFriend implements Cloneable { private String name; private int age; public void setAge(int age) { this.age = age; } public void setName(String...2012-04-11 17:41:49 · 71 阅读 · 0 评论 -
dynamic proxy
package dynamicProxy; public interface Man { public void say(); public void work(); } package dynamicProxy; public class ManOne implements Man { public void say() { Syste...2012-04-10 17:40:28 · 77 阅读 · 0 评论 -
static proxy
package staticProxy; public class Girl { private String name; public Girl(){} public Girl(String name) { this.name = name; } public String toString() { return name; } } ...2012-04-09 17:39:38 · 86 阅读 · 0 评论 -
singleton
package singleton; public class Wife { private static Wife wife; private static String name; private int age; public void setAge(int age){ this.age = age; } private Wife(){} ...2012-04-09 17:37:35 · 69 阅读 · 0 评论 -
method of factory
package methodOfFactory; public class People { private String name; private String sex; public People(){} public People(String name,String sex) { this.name = name; this.sex = sex;...2012-04-01 09:24:27 · 82 阅读 · 0 评论 -
state
package state; public interface State { public void operation(); } package state; public class StateOne implements State { public void operation() { System.out.println("出门遇到西施,...2012-04-13 17:53:34 · 173 阅读 · 0 评论