锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品美女视频,亚洲一区二区影视,亚洲一区二区三区无码国产http://www.tkk7.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.tkk7.com/dedian/archive/2006/05/12/45757.htmlDedianDedianThu, 11 May 2006 20:10:00 GMThttp://www.tkk7.com/dedian/archive/2006/05/12/45757.htmlhttp://www.tkk7.com/dedian/comments/45757.htmlhttp://www.tkk7.com/dedian/archive/2006/05/12/45757.html#Feedback0http://www.tkk7.com/dedian/comments/commentRss/45757.htmlhttp://www.tkk7.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.tkk7.com/dedian/archive/2006/05/12/45756.htmlDedianDedianThu, 11 May 2006 19:24:00 GMThttp://www.tkk7.com/dedian/archive/2006/05/12/45756.htmlhttp://www.tkk7.com/dedian/comments/45756.htmlhttp://www.tkk7.com/dedian/archive/2006/05/12/45756.html#Feedback0http://www.tkk7.com/dedian/comments/commentRss/45756.htmlhttp://www.tkk7.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.tkk7.com/dedian/archive/2006/04/20/42092.htmlDedianDedianThu, 20 Apr 2006 02:04:00 GMThttp://www.tkk7.com/dedian/archive/2006/04/20/42092.htmlhttp://www.tkk7.com/dedian/comments/42092.htmlhttp://www.tkk7.com/dedian/archive/2006/04/20/42092.html#Feedback0http://www.tkk7.com/dedian/comments/commentRss/42092.htmlhttp://www.tkk7.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.tkk7.com/dedian/archive/2006/04/20/42066.htmlDedianDedianThu, 20 Apr 2006 00:53:00 GMThttp://www.tkk7.com/dedian/archive/2006/04/20/42066.htmlhttp://www.tkk7.com/dedian/comments/42066.htmlhttp://www.tkk7.com/dedian/archive/2006/04/20/42066.html#Feedback0http://www.tkk7.com/dedian/comments/commentRss/42066.htmlhttp://www.tkk7.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.tkk7.com/dedian/archive/2006/04/20/42064.htmlDedianDedianThu, 20 Apr 2006 00:52:00 GMThttp://www.tkk7.com/dedian/archive/2006/04/20/42064.htmlhttp://www.tkk7.com/dedian/comments/42064.htmlhttp://www.tkk7.com/dedian/archive/2006/04/20/42064.html#Feedback0http://www.tkk7.com/dedian/comments/commentRss/42064.htmlhttp://www.tkk7.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.tkk7.com/dedian/archive/2006/04/19/42003.htmlDedianDedianWed, 19 Apr 2006 12:52:00 GMThttp://www.tkk7.com/dedian/archive/2006/04/19/42003.htmlhttp://www.tkk7.com/dedian/comments/42003.htmlhttp://www.tkk7.com/dedian/archive/2006/04/19/42003.html#Feedback0http://www.tkk7.com/dedian/comments/commentRss/42003.htmlhttp://www.tkk7.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.tkk7.com/dedian/archive/2006/04/19/42000.htmlDedianDedianWed, 19 Apr 2006 12:37:00 GMThttp://www.tkk7.com/dedian/archive/2006/04/19/42000.htmlhttp://www.tkk7.com/dedian/comments/42000.htmlhttp://www.tkk7.com/dedian/archive/2006/04/19/42000.html#Feedback0http://www.tkk7.com/dedian/comments/commentRss/42000.htmlhttp://www.tkk7.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.tkk7.com/dedian/archive/2006/04/19/41999.htmlDedianDedianWed, 19 Apr 2006 12:33:00 GMThttp://www.tkk7.com/dedian/archive/2006/04/19/41999.htmlhttp://www.tkk7.com/dedian/comments/41999.htmlhttp://www.tkk7.com/dedian/archive/2006/04/19/41999.html#Feedback0http://www.tkk7.com/dedian/comments/commentRss/41999.htmlhttp://www.tkk7.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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 1区1区3区4区产品亚洲| 亚洲精品字幕在线观看| 亚洲男人天堂2018av| 最近免费中文在线视频| 久久久久亚洲AV无码网站| 日韩在线不卡免费视频一区| 国产亚洲AV无码AV男人的天堂| 国产一级一毛免费黄片| 亚洲精品蜜桃久久久久久| 免费播放在线日本感人片| 亚洲国产第一页www| 免费A级毛片无码A∨免费| 亚洲av无码电影网| 成年女人永久免费观看片| 鲁啊鲁在线视频免费播放| 亚洲伊人色欲综合网| 99精品视频免费观看| tom影院亚洲国产一区二区| 女人18毛片水真多免费看| 国产成人亚洲精品电影| 亚洲最大AV网站在线观看| 久久国产精品一区免费下载| 亚洲国产成人无码av在线播放| 成人毛片免费观看视频大全| 高潮毛片无遮挡高清免费| 国产亚洲综合网曝门系列| 国产精品免费观看| 亚洲av永久无码精品网址| 国产综合亚洲专区在线| 24小时在线免费视频| 国产大陆亚洲精品国产| 国产亚洲精品岁国产微拍精品| 精品无码AV无码免费专区| 久久精品国产亚洲AV天海翼| 亚洲综合AV在线在线播放| 麻豆高清免费国产一区| 日本系列1页亚洲系列| 久久久久亚洲av无码专区导航| 日韩在线看片免费人成视频播放| 中文字幕在线免费视频| 亚洲一区在线免费观看|