锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品美女视频,亚洲一区二区影视,亚洲一区二区三区无码国产http://m.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://m.tkk7.com/dedian/archive/2006/05/12/45757.htmlDedianDedianThu, 11 May 2006 20:10:00 GMThttp://m.tkk7.com/dedian/archive/2006/05/12/45757.htmlhttp://m.tkk7.com/dedian/comments/45757.htmlhttp://m.tkk7.com/dedian/archive/2006/05/12/45757.html#Feedback0http://m.tkk7.com/dedian/comments/commentRss/45757.htmlhttp://m.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://m.tkk7.com/dedian/archive/2006/05/12/45756.htmlDedianDedianThu, 11 May 2006 19:24:00 GMThttp://m.tkk7.com/dedian/archive/2006/05/12/45756.htmlhttp://m.tkk7.com/dedian/comments/45756.htmlhttp://m.tkk7.com/dedian/archive/2006/05/12/45756.html#Feedback0http://m.tkk7.com/dedian/comments/commentRss/45756.htmlhttp://m.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://m.tkk7.com/dedian/archive/2006/04/20/42092.htmlDedianDedianThu, 20 Apr 2006 02:04:00 GMThttp://m.tkk7.com/dedian/archive/2006/04/20/42092.htmlhttp://m.tkk7.com/dedian/comments/42092.htmlhttp://m.tkk7.com/dedian/archive/2006/04/20/42092.html#Feedback0http://m.tkk7.com/dedian/comments/commentRss/42092.htmlhttp://m.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://m.tkk7.com/dedian/archive/2006/04/20/42066.htmlDedianDedianThu, 20 Apr 2006 00:53:00 GMThttp://m.tkk7.com/dedian/archive/2006/04/20/42066.htmlhttp://m.tkk7.com/dedian/comments/42066.htmlhttp://m.tkk7.com/dedian/archive/2006/04/20/42066.html#Feedback0http://m.tkk7.com/dedian/comments/commentRss/42066.htmlhttp://m.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://m.tkk7.com/dedian/archive/2006/04/20/42064.htmlDedianDedianThu, 20 Apr 2006 00:52:00 GMThttp://m.tkk7.com/dedian/archive/2006/04/20/42064.htmlhttp://m.tkk7.com/dedian/comments/42064.htmlhttp://m.tkk7.com/dedian/archive/2006/04/20/42064.html#Feedback0http://m.tkk7.com/dedian/comments/commentRss/42064.htmlhttp://m.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://m.tkk7.com/dedian/archive/2006/04/19/42003.htmlDedianDedianWed, 19 Apr 2006 12:52:00 GMThttp://m.tkk7.com/dedian/archive/2006/04/19/42003.htmlhttp://m.tkk7.com/dedian/comments/42003.htmlhttp://m.tkk7.com/dedian/archive/2006/04/19/42003.html#Feedback0http://m.tkk7.com/dedian/comments/commentRss/42003.htmlhttp://m.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://m.tkk7.com/dedian/archive/2006/04/19/42000.htmlDedianDedianWed, 19 Apr 2006 12:37:00 GMThttp://m.tkk7.com/dedian/archive/2006/04/19/42000.htmlhttp://m.tkk7.com/dedian/comments/42000.htmlhttp://m.tkk7.com/dedian/archive/2006/04/19/42000.html#Feedback0http://m.tkk7.com/dedian/comments/commentRss/42000.htmlhttp://m.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://m.tkk7.com/dedian/archive/2006/04/19/41999.htmlDedianDedianWed, 19 Apr 2006 12:33:00 GMThttp://m.tkk7.com/dedian/archive/2006/04/19/41999.htmlhttp://m.tkk7.com/dedian/comments/41999.htmlhttp://m.tkk7.com/dedian/archive/2006/04/19/41999.html#Feedback0http://m.tkk7.com/dedian/comments/commentRss/41999.htmlhttp://m.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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲黄色免费电影| 亚洲性久久久影院| 亚洲国产综合精品| 一区二区三区四区免费视频| 在线亚洲午夜理论AV大片| 日本永久免费a∨在线视频| 免费一级毛片在线播放| 男男黄GAY片免费网站WWW| 国产成人aaa在线视频免费观看| 美女视频黄a视频全免费网站一区 美女视频黄a视频全免费网站色 | 夜夜爽免费888视频| 亚洲精品无码你懂的| 国产在线98福利播放视频免费| 在线看亚洲十八禁网站| 亚洲中文字幕丝袜制服一区| 91在线视频免费观看| 亚洲日本va午夜中文字幕一区| 最近中文字幕大全免费视频| 亚洲 暴爽 AV人人爽日日碰| 国产精品jizz在线观看免费| www成人免费观看网站| 亚洲午夜视频在线观看| 在线a级毛片免费视频| 国产亚洲综合视频| 日韩亚洲欧洲在线com91tv| 18女人腿打开无遮掩免费| 亚洲精品无码国产片| 亚洲精品成人区在线观看| 午夜不卡久久精品无码免费 | 日韩a级无码免费视频| 久久亚洲春色中文字幕久久久| 一二三四在线播放免费观看中文版视频 | 久久99毛片免费观看不卡| 亚洲国产亚洲片在线观看播放| 爽爽日本在线视频免费| 免费人成在线视频| 黄页视频在线观看免费| 亚洲成a人片在线观看无码专区 | 全部免费毛片在线| 久久久久国产免费| 国产偷国产偷亚洲清高APP|