
Design Pattern
WonderOne
这个作者很懒,什么都没留下…
展开
-
IoC模式的类型及其实现
1引言 面向对象的思想已经深入人心,但是要利用面向对象的思想开发出优秀的应用程序却不是一件容易的事情。正是基于面向对象的思想,人们对各种应用程序进行了大量的分析、总结、归纳出了设计模式。Alexanders给出模式的经典定义是:每个模式都描述了一个在我们的环境中不断出现的问题,然后描述了该问题的解决方案的核心。通过这种方式,你可以无数次地使用那些已有的解决方案,无需再重复相同的工作[2]原创 2004-12-03 00:24:00 · 2502 阅读 · 0 评论 -
IoC Introduction
Introduction to IoCSee IoC example on why to use IoC with an example in Pico. Changes to this example to use it with Spring are in Spring example. Example for conventional lookup (e.g. with JNDI原创 2004-12-03 00:28:00 · 1225 阅读 · 0 评论 -
简单工厂、工厂、抽象工厂的区别
工厂方法模式的核心是一个抽象工厂类,而简单工厂模式把核心放到了一个具体类上. 简单工厂是工厂方法模式的特例。 工厂方法模式和抽象工厂模式的最主要的区别在于对工厂的抽象程度上。 抽象工厂模式中一般是抽象出工厂接口,表示他就是一个工厂,而不管它是制造什么产品的工厂,他的抽象程度较高。 而工厂方法模式的抽象工厂一般是针对于产品进行抽象,表示它是一个生产某类产品的工厂。 简单工厂是不支持继承原创 2004-12-11 01:05:00 · 1368 阅读 · 0 评论 -
Simply Singleton -- part2 By David Geary
Test singletons Throughout the rest of this article, I use JUnit in concert with log4j to test singleton classes. If you are not familiar with JUnit or log4j, see Resources. Example 2 lists a JUnit原创 2004-12-20 16:29:00 · 1478 阅读 · 0 评论 -
Simply Singleton -- part1 By David Geary
Use a registry Use a singleton registry to: Specify singleton classes at runtime Prevent singleton subclasses from allowing multiple instancesExample 8 lists a singleton class that maintains a原创 2004-12-20 16:31:00 · 1391 阅读 · 0 评论