锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲欧美网站在线观看,菠萝蜜视频在线观看一区,国产精品视频区http://www.aygfsteel.com/dedian/category/11495.html-- 鍏蟲敞鎼滅儲寮曟搸鐨勫紑鍙?/description>zh-cnWed, 28 Feb 2007 07:45:37 GMTWed, 28 Feb 2007 07:45:37 GMT60Design Patterns - 8 - Proxyhttp://www.aygfsteel.com/dedian/archive/2006/05/12/45757.htmlDedianDedianThu, 11 May 2006 20:10:00 GMThttp://www.aygfsteel.com/dedian/archive/2006/05/12/45757.htmlhttp://www.aygfsteel.com/dedian/comments/45757.htmlhttp://www.aygfsteel.com/dedian/archive/2006/05/12/45757.html#Feedback0http://www.aygfsteel.com/dedian/comments/commentRss/45757.htmlhttp://www.aygfsteel.com/dedian/services/trackbacks/45757.html
To control access to an object, provide a surrogate or placeholder (proxy) for it. As a mostly used strategy, Proxy can defer the creation and initialization of the object until it is on demand.

Structure:

Similar to adapter, client includes an object of proxy to access, and proxy includes a real object that proxy represents.

Difference from Adapter:

Adapter provides a different interface to the object it adapts. In contrast, Proxy provides the same interface as its subject. As a protection of real object, Proxy can refuse to perform an operation that the subject will perform.

Example:
http://www.javaworld.com/javaworld/jw-02-2002/jw-0222-designpatterns.html

Reference:
Book: (GoF)Design Patterns
http://en.wikipedia.org/wiki/Proxy_design_pattern
http://www.inf.bme.hu/ooret/1999osz/DesignPatterns/Proxy4/
http://alumni.media.mit.edu/~tpminka/patterns/Proxy.html




Dedian 2006-05-12 04:10 鍙戣〃璇勮
]]>
Design Patterns - 7 - Mediatorhttp://www.aygfsteel.com/dedian/archive/2006/05/12/45756.htmlDedianDedianThu, 11 May 2006 19:24:00 GMThttp://www.aygfsteel.com/dedian/archive/2006/05/12/45756.htmlhttp://www.aygfsteel.com/dedian/comments/45756.htmlhttp://www.aygfsteel.com/dedian/archive/2006/05/12/45756.html#Feedback0http://www.aygfsteel.com/dedian/comments/commentRss/45756.htmlhttp://www.aygfsteel.com/dedian/services/trackbacks/45756.html
Encapsulate a set of objects which interact with each other. The benefit to do this is keeping objects from communicating with each other directly. All the messages between objects should be sent to mediator at first and then mediator will control and coordinate those interaction. Also, mediator can handle external interaction request and decide which object to response the external request.

Structure:

star topology: Mediator class is as a hub which connects to a set of classes (colleague classes).

Difference from Facade Pattern:

Facade differs from Mediator in that it abstracts a subsystem of objects to provide a more convenient interface. Its protocol is unidirectional. That is, Facade objects make requests of the subsystem classes but not vice versa. In contrast, Mediator enables cooperative behavior that colleague objects don't or can't provide, and the protocol is multidirectional.

reference:

Gamma, E., R. Helm, R. Johnson, J. Vlissides (1995). Design Patterns. Addison Wesley. ISBN 0.201-63361-2
http://sern.ucalgary.ca/courses/seng/443/W02/assignments/Mediator/
http://my.execpc.com/~gopalan/design/behavioral/mediator/mediator.html


Dedian 2006-05-12 03:24 鍙戣〃璇勮
]]>
Design Patterns - 6 - Facadehttp://www.aygfsteel.com/dedian/archive/2006/04/20/42092.htmlDedianDedianThu, 20 Apr 2006 02:04:00 GMThttp://www.aygfsteel.com/dedian/archive/2006/04/20/42092.htmlhttp://www.aygfsteel.com/dedian/comments/42092.htmlhttp://www.aygfsteel.com/dedian/archive/2006/04/20/42092.html#Feedback0http://www.aygfsteel.com/dedian/comments/commentRss/42092.htmlhttp://www.aygfsteel.com/dedian/services/trackbacks/42092.html Defines a higher-level interface to hide subsystem's complexities and provides an easy interface for client to use.

Case study:
Compiler subsystem

Structure:
-- The facade and backend classes(subsystem classes) are in a separate package from the client.
-- The backend API is package-private
-- The facade API is public.

Implementation:
consider following two issues when implementing a facade:
-- Reducing client-subsystem coupling.
-- Public versus private subsystem classes.

reference:
http://www.allapplabs.com/java_design_patterns/facade_pattern.htm


Dedian 2006-04-20 10:04 鍙戣〃璇勮
]]>
Design Patterns - 5 - Decoratorhttp://www.aygfsteel.com/dedian/archive/2006/04/20/42066.htmlDedianDedianThu, 20 Apr 2006 00:53:00 GMThttp://www.aygfsteel.com/dedian/archive/2006/04/20/42066.htmlhttp://www.aygfsteel.com/dedian/comments/42066.htmlhttp://www.aygfsteel.com/dedian/archive/2006/04/20/42066.html#Feedback0http://www.aygfsteel.com/dedian/comments/commentRss/42066.htmlhttp://www.aygfsteel.com/dedian/services/trackbacks/42066.html Attach additional responsiblities to an object dynamically, which thus provide a flexible alternative to subclassing for extending functionality.

Structure:
Typically, there will be a parameter to pass original object to decorator object in its constructor, then decorator can implement additional functions within its own interface and apply to original object.

when to use:

-- when subclassing is not avaible
-- when the responsibilities (for different functions) are required flexiable and dynamical
-- can not predict combination of extending functionality. (We can not design subclasses for all combination of potential additional functionalities at compile time)

reference:
Book: Design Pattern (GoF)
http://en.wikipedia.org/wiki/Decorator_pattern

Dedian 2006-04-20 08:53 鍙戣〃璇勮
]]>
Design Patterns - 4 - Compositehttp://www.aygfsteel.com/dedian/archive/2006/04/20/42064.htmlDedianDedianThu, 20 Apr 2006 00:52:00 GMThttp://www.aygfsteel.com/dedian/archive/2006/04/20/42064.htmlhttp://www.aygfsteel.com/dedian/comments/42064.htmlhttp://www.aygfsteel.com/dedian/archive/2006/04/20/42064.html#Feedback0http://www.aygfsteel.com/dedian/comments/commentRss/42064.htmlhttp://www.aygfsteel.com/dedian/services/trackbacks/42064.html Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compostions of objects uniformly.

Structure:
The composite object contains other primitive objects(or say Components), and has the same operation as in those primitive objects. Thus we can operater the composite object with the same operations as a whole. Or in other word, composite object is a container of primitive ojects and itself is derived from same base (abstract) class as primitives, so that it can have same operations as primitives. Actually, we can say that the abstract class represents both primitives and their containers

Implementation:
-- Extend a base class that represents primitive objects. And the same operation(override function) will be implemented by iterating over that collection and invoking the appropriate method for each component in the collection.
-- Add & Remove function (for component collection) will be defined in base class, though it is meaninglessful for leaf classes.

reference:
http://www.javaworld.com/javaworld/jw-09-2002/jw-0913-designpatterns.html
http://www.codeproject.com/useritems/Composite.asp

example:
http://java.sun.com/blueprints/patterns/CompositeView.html

Dedian 2006-04-20 08:52 鍙戣〃璇勮
]]>
Design Patterns - 3 - Bridgehttp://www.aygfsteel.com/dedian/archive/2006/04/19/42003.htmlDedianDedianWed, 19 Apr 2006 12:52:00 GMThttp://www.aygfsteel.com/dedian/archive/2006/04/19/42003.htmlhttp://www.aygfsteel.com/dedian/comments/42003.htmlhttp://www.aygfsteel.com/dedian/archive/2006/04/19/42003.html#Feedback0http://www.aygfsteel.com/dedian/comments/commentRss/42003.htmlhttp://www.aygfsteel.com/dedian/services/trackbacks/42003.htmlDecouple an abstraction from its implementation so that the two can vary independently.

To think about this situation that an abstract class has two categories of inheritance. Each category can be a seperate hierarchical inheritance聽tree, if we聽derive all the subclasses from the abstract class, it will make complex聽when we need to get some sub-classes that contains facades from two categories. So we need seperate those subclasses into differenct categories, typically one into implementation hierarchy while another into abstraction hierarchy which can聽employ subclasses of implementation hierarchy. No matter how, the relationship between different hierarchies is a bridge. From this point, the bridge pattern design lets different hierarchies can evolve seperately.

The structure of the Adapter Pattern (object adapter) may look similar to the Bridge Pattern. However, the adapter is meant to change the interface of an existing object and is mainly intended to make unrelated classes work together.

reference:
book:"Design Patterns鈥?Gamma et al.
http://en.wikipedia.org/wiki/Bridge_pattern
http://www.c-sharpcorner.com/Language/BridgePatternsinCSRVS.asp
http://www.codeproject.com/gen/design/bridge.asp


Dedian 2006-04-19 20:52 鍙戣〃璇勮
]]>
Design Patterns - 2 - Adapterhttp://www.aygfsteel.com/dedian/archive/2006/04/19/42000.htmlDedianDedianWed, 19 Apr 2006 12:37:00 GMThttp://www.aygfsteel.com/dedian/archive/2006/04/19/42000.htmlhttp://www.aygfsteel.com/dedian/comments/42000.htmlhttp://www.aygfsteel.com/dedian/archive/2006/04/19/42000.html#Feedback0http://www.aygfsteel.com/dedian/comments/commentRss/42000.htmlhttp://www.aygfsteel.com/dedian/services/trackbacks/42000.html
Object Adapter:

-- use compositional technique
-- by composing interface B's instance within interface A (target interface, adapter) and implement interface A in terms of B's interface(adaptee). Interface A is Object Adapter which enables the client (the class or object to use Interface A) and the adaptee(Interface B) to be completely decoupled from each other.

Class Adapter:

-- use multiple inheritance
-- Notice that Java is not supporting true multiple inheritance, there must be one inheritance is from Java Interface(implementation) not Java class. So take above Object Adapter as example, if client want to access Interface B, the adpater Interface A will inherit from class(Class Adapter) which Client can access, and inherit the implementation of Interface B(Adaptee). So Interface A can have a funtion to call functions in Interface B, and so that Interface will not have an object of Interface B, that is the difference from Object Adapter method.

reference:
http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/adapter.htm



Dedian 2006-04-19 20:37 鍙戣〃璇勮
]]>
Design Patterns - 1 - Abstract Factory (Creatioanl)http://www.aygfsteel.com/dedian/archive/2006/04/19/41999.htmlDedianDedianWed, 19 Apr 2006 12:33:00 GMThttp://www.aygfsteel.com/dedian/archive/2006/04/19/41999.htmlhttp://www.aygfsteel.com/dedian/comments/41999.htmlhttp://www.aygfsteel.com/dedian/archive/2006/04/19/41999.html#Feedback0http://www.aygfsteel.com/dedian/comments/commentRss/41999.htmlhttp://www.aygfsteel.com/dedian/services/trackbacks/41999.html
reference:

http://gsraj.tripod.com/design/creational/factory/factory.html
http://en.wikipedia.org/wiki/Factory_method_pattern
http://www.developer.com/java/other/article.php/626001
http://www.javacamp.org/designPattern/factory.html


Dedian 2006-04-19 20:33 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 吴江市| 景东| 孟州市| 巫山县| 巴楚县| 永定县| 湖北省| 繁昌县| 宁津县| 内黄县| 儋州市| 桃源县| 长白| 靖远县| 民勤县| 五莲县| 枣强县| 河源市| 四平市| 佛山市| 海林市| 安龙县| 淮南市| 兴安县| 玛多县| 陈巴尔虎旗| 民勤县| 嘉荫县| 神农架林区| 那曲县| 云霄县| 垦利县| 沾益县| 通江县| 荔浦县| 夏津县| 江阴市| 呼玛县| 抚宁县| 合水县| 佛冈县|