- 浏览: 664900 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
sztime:
可以在文本框上绑定事件来禁用回车键, 我就是这样做的.在IE中 ...
form 回车自动提交问题 -
damoqiongqiu:
非常好的文章,很透彻不过有一句话小僧腆着脸补充一下:“1111 ...
为什么要用补码来做存储 -
wuyizhong:
原来如此啊。
form 回车自动提交问题 -
luliangy:
谢楼主~!
用C语言扩展Python的功能 -
kwong:
很有用,谢谢
火狐和IE 对css 样式解释的差异
Have you ever heard Xerox PARC (Palo Alto Research Center, @see http://en.wikipedia.org/wiki/PARC_(company) )? This research center has many great innovations. GUI (Graphical User Interface) is one of them.
The history of GUI is an interesting story. After the PARC invent the GUI, they didn’t put this into business immediately. Sometimes later, a young man visited this center, and was shocked by the great innovations including the GUI. When the young man backed to his company, he put those ideas into their product, Macintosh, the first commercially successful product using GUI. And the young man, the CEO of that fruit company, began his legend in Silicon Valley.
OK, let’s turn to our topic today. Have you ever think about something under the GUI? Such as, when you click a button, how the computer will do? I mean the way, not the result. For example, when you click “open”, maybe it will show you a file chooser dialog. The file chooser dialog is the result, and the way to get the result maybe very complex. I think this is the great of GUI, you needn’t know the way, and you just need to know the result. All the details were covered by the system.
This situation was very common in our daily life. When you drive your car, you just put your foot on the accelerator pedal. Of course, you don’t know the details how the cat started, except you’ve ever studied it.
There is a pattern corresponding to these situations. It was called Façade.
Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.
– By THE GOF BOOK
In the car example, you don’t know the inner structure of the car. And the car supplies you a higher-level interface, the accelerator pedal. Let’s mimic this example.
In order to make it easier to understand, we will only use three classes to illustrate this example, the Car, CarEngine and CarWheel.
You can see the diagram below.
< click to see oraginal image file>
Also, it can be described as blew.
< click to see oraginal image file>
From the client side, the car is a subsystem. And the client doesn’t need to know the internal structure of the car. All he need is the high-level interfaces.
You can see the source code for more information( Download Full Project ).
As you see, this pattern is mainly use for reduce the complex of the subsystem, when you want to use some function provide by a subsystem. You don’t need to know the details about the subsystem, if you use this pattern. You just need to know the interfaces. It’s very helpful when you cooperate with others.
Enjoy!
发表评论
-
设计模式 图析
2011-09-24 14:27 735【observer】 【adapter】 【comm ... -
一个设计模式的图片
2009-05-03 02:14 540... -
Design Patterns in ActionScript–Factory Method
2009-02-24 13:37 768In our last topic, we talk abou ... -
Design Patterns in ActionScript-Strategy
2009-02-24 13:34 572Today, we’re going to talk abou ... -
Design Patterns in ActionScript-Mediator
2009-02-24 13:29 508Ok, the last pattern now. Let’s ... -
Design Patterns in ActionScript-Command
2009-02-24 13:21 621A few months ago, I was an inte ... -
Design Patterns in ActionScript-Chain of Responsib
2009-02-24 13:12 602When you need some help in a ho ... -
Design Patterns in ActionScript-Flyweight
2009-02-24 13:07 640In Action Script 3.0 we have th ... -
Design Patterns in ActionScript-Visitor
2009-02-24 11:26 513It’s our winter holiday now, an ... -
Design Patterns in ActionScript-Memento
2009-02-23 23:38 519Now, I’m using Microsoft word t ... -
Design Patterns in Action Script-Composite
2009-02-23 14:29 516Still remember the Interpreter ... -
Design Patterns in ActionScript-Interpreter
2009-02-23 14:26 665In web programming, we often us ... -
Design Patterns in ActionScript-Proxy
2009-02-23 14:19 631Have you ever use HTTP-proxy or ... -
Design Patterns in Action Script-State
2009-02-23 14:17 959Yesterday, when I was on my way ... -
Design Patterns in ActionScript-Builder
2009-02-23 14:16 522Have you ever buy a computer on ... -
Design Patterns in ActionScript-Prototype
2009-02-23 14:12 667When I want to write the Protot ... -
Design Patterns in ActionScript-Iterator
2009-02-23 14:07 577There is a famous saying in com ... -
Design Patterns in Action Script-Template Method
2009-02-23 14:04 497Do you like playing cards? If y ... -
Design Patterns in ActionScript-Observer
2009-02-23 14:00 593In GUI programming, event-drive ... -
Design Patterns in ActionScript-Singleton
2009-02-23 13:55 527In our real world, many things ...
相关推荐
《ActionScript设计模式》是软件开发领域中针对ActionScript编程语言的一种实践指南,它深入探讨了如何在ActionScript项目中应用经典的设计模式。设计模式是软件工程中的宝贵经验总结,它们是解决常见问题的可复用...
design pattern in C# language
Design Patterns in Modern C++: Reusable Approaches for Object-Oriented Software Design English | PDF| 2018 | 312 Pages | ISBN : 1484236025Design Patterns in Modern C++: Reusable Approaches for Object...
Too often design patterns are explained using tricky concepts, when in fact they are easy to use and can enrich your everyday development. Design Patterns in ...
Learn how to implement design patterns in Java: each pattern in Java Design Patterns is a complete implementation and the output is generated using Eclipse, making the code accessible to all....
App Architecture: iOS Application Design Patterns in Swift 包含Source code 有钱请支持正版 没钱请默默学习 原书地址: https://www.objc.io/books/app-architecture 中文原书地址: ...
Alan Ezust在其著作《An Introduction to Design Patterns in C++ with Qt™, 2nd Edition》中探讨了设计模式的这一概念,并且在Qt框架的基础上讲解了如何在C++项目中应用这些设计模式。 C++是一种高性能、多范式的...
Data Structures And Algorithms With Object-oriented Design Patterns In Java.chm
and applications that run on various software and hardware platforms with little or no change in the underlying codebase, while still being a native application with native capabilities and speed....
Design Patterns in Modern C++ Reusable Approaches for Object-Oriented Software Design 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Design Patterns in Java(2nd) 英文epub 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Implement structural patterns such as adapter, bridge, decorator, facade and more Work with the behavioral patterns such as chain of responsibility, command, iterator, mediator and more Apply ...
Pro Design Patterns in Swift 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者...
本书《Design Patterns by Tutorials Learning design patterns in Swift 4.2, 2nd Edition》主要介绍在Swift 4.2环境下,如何通过教程学习设计模式。设计模式是软件开发中的一个重要概念,它是一套被反复使用、多数...