锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲自啪免费,欧美午夜精品一区,欧美精品日日鲁夜夜添http://m.shnenglu.com/beautykingdom/category/12496.htmlzh-cnThu, 09 Jun 2011 17:47:22 GMTThu, 09 Jun 2011 17:47:22 GMT60How I explained Design Patterns to my wife銆妑eprint銆?/title><link>http://m.shnenglu.com/beautykingdom/archive/2011/06/08/148264.html</link><dc:creator>chatler</dc:creator><author>chatler</author><pubDate>Wed, 08 Jun 2011 06:14:00 GMT</pubDate><guid>http://m.shnenglu.com/beautykingdom/archive/2011/06/08/148264.html</guid><wfw:comment>http://m.shnenglu.com/beautykingdom/comments/148264.html</wfw:comment><comments>http://m.shnenglu.com/beautykingdom/archive/2011/06/08/148264.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/beautykingdom/comments/commentRss/148264.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/beautykingdom/services/trackbacks/148264.html</trackback:ping><description><![CDATA[<span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; border-collapse: separate; font: 16px 'Times New Roman'; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="line-height: 16px; font-family: Verdana, Arial, sans-serif; font-size: 13px" class="Apple-style-span"> <h2 style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; color: rgb(255,153,0); font-size: 13pt; font-weight: bold">Introduction</h2> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">Me and my wife had some interesting conversations on<span id="hvzpftn" class="Apple-converted-space"> </span><a style="color: rgb(0,76,213); text-decoration: none" >Object Oriented Design principles</a>. After publishing the conversation on CodeProject, I got some good responses from the community and that really inspired me. So, I am happy to share our next conversation that took place on Object Oriented Design Patterns. Here it is.</p> <h2 style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; color: rgb(255,153,0); font-size: 13pt; font-weight: bold">What is a Design Pattern?</h2> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: I guess you already have some basic idea about Object Oriented Design principles. We had a nice talk on the OOD principles (SOLID principles), and I hope you didn't mind that I published our conversation in a CodeProject article. You can find it here:<span id="hvzpftn" class="Apple-converted-space"> </span><a style="color: rgb(0,76,213); text-decoration: none" >How I explained OOD to my wife</a>.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">Design Patterns are nothing but applications of those principles in some specific and common situations, and standardizing some of those. Let's try to understand what Design Patterns are by using some examples.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Sure, I love examples.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Let's talk about our car. It's an object, though a complex one, which consists of thousands of other objects such as the engine, wheels, steering, seats, body, and thousands of different parts and machinery.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/Engine.jpg" width="150" height="150" complete="true" alt="" /><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/Wheel.jpg" width="150" height="99" complete="true" alt="" /><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/Parts.jpg" width="150" height="112" complete="true" alt="" /><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/lights.jpg" width="98" height="150" complete="true" alt="" /><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/steering.jpg" width="150" height="93" complete="true" alt="" /></p> <div style="font-style: italic; font-size: 8pt; font-weight: bold" class="Caption">Different parts of a car.</div> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">While building this car, the manufacturer gathered and assembled all the different smaller parts that are subsystems of the car. These different smaller parts are also some complex objects, and some other manufacturers had to build and assemble those too. But, while building the car, the car company doesn't really bother too much about how those objects were built and assembled (well, as long as they are sure about the quality of these smaller objects/equipments). Rather, the car manufacturer cares about how to assemble those different objects into different combinations and produce different models of cars.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/car1.jpg" width="150" height="74" complete="true" alt="" /><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/car2.jpg" width="150" height="78" complete="true" alt="" /><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/car3.jpg" width="150" height="98" complete="true" alt="" /></p> <div style="font-style: italic; font-size: 8pt; font-weight: bold" class="Caption">Different models of cars, produced by assembling different parts and following different designs.</div> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: The car manufacturer company must have some designs or blue prints for each different model of car which they follow, right?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Definitely, and, these designs are well-thought designs, and they've put a good amount of time and effort to sketch those designs. Once the designs are finalized, producing a car is just a matter of following the designs.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Hm.. it's good to have some good designs upfront and following those allows to produce different products in a quick amount of time, and each time the manufacturer has to build a product for a specific model, they don't have to develop a design from scratch or re-invent the wheel, they just follow the designs.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/plan1.jpg" width="249" height="149" complete="true" alt="" /><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/plan2.jpg" width="286" height="176" complete="true" alt="" /></p> <div style="font-style: italic; font-size: 8pt; font-weight: bold" class="Caption">Different design plans for producing different models of products (cars).</div> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: You got the point. Now, we are software manufacturers and we build different kinds of software programs with different components or functionality based upon the requirements. While building such different software systems, we often have to develop code for some situations that are common in many different software systems, right?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Yes. And often, we face common design problems while developing different software applications.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: We try to develop our software applications in an Object Oriented manner and try to apply OOD principles for achieving code that is manageable, reusable, and expandable. Wouldn't it be nice whenever we see such design problems, we have a pool of some carefully made and well tested designs of objects for solving those?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Yes, that would save us time and would also allow us to build better software systems and manage them later.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Perfect. The good news is, you don't have to really develop that pool of object designs from scratch. People already have gone through similar design problems for years, and they already have identified some good design solutions which have been standardized already. We call these Design Patterns.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">We must thank the Gang of Four (GoF) for identifying the 23 basic Design Patterns in their book<span id="hvzpftn" class="Apple-converted-space"> </span><strong>Design Patterns: Elements of Reusable Object-Oriented Software</strong>. In case you are wondering who formed this famous gang, they are Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. There are many Object Oriented Design Patterns, but these 23 patterns are generally considered the foundation for all other Design Patterns.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Can I create a new pattern? Is that possible?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Yes darling, why not? Design Patterns are not something invented or newly created by scientists. They are just discovered. That means, for each kind of common problem scenario, there must be some good design solutions there. If we are able to identify an object oriented design that could solve a new design related problem, that would be a new Design Pattern defined by us. Who knows? If we discover some a Design Pattern, someday people may call us Gang of Two.. Ha ha.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Fahana</strong>: :)</p> <h2 style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; color: rgb(255,153,0); font-size: 13pt; font-weight: bold">How will we learn Design Patterns?</h2> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: As I have always believed, examples are the greatest way of learning. In our learning approach, we won't discuss the theories first and implement later. I think this is a BAD approach. Design Patterns were not invented based on theories. Rather, the problem situations occurred first and based upon the requirement and context, some design solutions were evolved, and later some of them were standardized as patterns. So, for each design pattern we discuss, we will try to understand and analyze some real life example problems, and then we will try to formulate a design in a step by step process and end up with a design that will match with some patterns; Design Patterns were discovered in this same process. What do you think?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: I think this approach makes more sense to me. If I can end up with Design Patterns by analyzing problems and formulating solutions, I won't have to memorize design diagrams and definitions. Please proceed using your approach.</p> <h2 style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; color: rgb(255,153,0); font-size: 13pt; font-weight: bold">A basic design problem and its solution</h2> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Let's consider the following scenario:</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">Our room has some electric equipments (lights, fans etc). The equipments are arranged in a way where they could be controlled by switches. At any time, you can replace or troubleshoot an electrical equipment without touching the other things. For example, you can replace a light with another without replacing or changing the switch. Also, you can replace a switch or troubleshoot it without touching or changing the corresponding light or fan; you can even connect the light with the fan's switch and connect the fan with the light's switch, without touching the switches.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/fan.jpg" width="258" height="196" complete="true" alt="" /><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/light.jpg" width="129" height="215" complete="true" alt="" /></p> <div style="font-style: italic; font-size: 8pt; font-weight: bold" class="Caption">Electrical equipments: A fan and a light.</div> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/normalswitch.jpg" width="186" height="191" complete="true" alt="" /><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/fancyswitch.jpg" width="155" height="147" complete="true" alt="" /></p> <div style="font-style: italic; font-size: 8pt; font-weight: bold" class="Caption">Two different switches for fan and light, one is normal and the other is fancy.</div> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Yes, but that's natural, right?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Yes, that's very natural, and that's how the arrangement should be. When different things are connected together, they should be connected in a way where change or replacement of one system doesn't affect another, or even if there is any effect, it stays minimal. This allows you to manage your system easily and at low cost. Just imagine if changing the light in your room requires you to change the switch also. Would you care to purchase and set up such a system in your house?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Definitely no.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Now, let's think how the lights or fans are connected with the switches so that changing one doesn't have any impact on the other. What do you think?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: The wire, of course!</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Perfect. It's the wire and the electrical arrangement that connect the lights/fans with the switches. We can generalize it as a bridge between the different systems that can get connected through it. The basic idea is, things shouldn't be directly connected with one another. Rather, they should be connected though some bridges or interfaces. That's what we call "loose coupling" in software world.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: I see. I got the idea.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Now, let's try to understand some key issues in the light/fan and switch analogy, and try to understand how they are designed and connected.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: OK, let me try.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">We have switches in our example. There may be some specific kinds of switches like normal switches, fancy ones, but, in general, they are switches. And, each switch can be turned on and off.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">So, we will have a base<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Switch</code><span id="hvzpftn" class="Apple-converted-space"> </span>class as follows:</p> <div style="text-align: right !important; display: block; font-size: 8pt !important" id="premain0" class="small-text align-right" width="100%"><img style="overflow-x: auto; overflow-y: auto; cursor: pointer" id="preimg0" src="http://www.codeproject.com/images/minus.gif" width="9" height="9" preid="0" alt="" /><span style="margin-bottom: 0px; cursor: pointer" id="precollapse0" preid="0"><span id="hvzpftn" class="Apple-converted-space"> </span>Collapse</span></div><pre style="border-bottom: rgb(251,237,187) 1px solid; border-left: rgb(251,237,187) 1px solid; padding-bottom: 6px; overflow-x: auto; overflow-y: auto; background-color: rgb(251,237,187); margin-top: 0px; padding-left: 6px; padding-right: 6px; font: 9pt 'Courier New', Courier, mono; word-wrap: break-word; white-space: pre-wrap; border-top: rgb(251,237,187) 1px solid; border-right: rgb(251,237,187) 1px solid; padding-top: 6px" id="pre0" lang="cs"><span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">class</span> Switch { <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> On() { <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">Switch has an on button </span> } <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> Off() { <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">Switch has an off button </span> } }</pre> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">And, as we may have some specific kinds of switches, for example a fancy switch, a normal switch etc., we will also have<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">FancySwitch</code><span id="hvzpftn" class="Apple-converted-space"> </span>and<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">NormalSwitch</code><span id="hvzpftn" class="Apple-converted-space"> </span>classes extending the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Switch</code><span id="hvzpftn" class="Apple-converted-space"> </span>class:</p> <div style="text-align: right !important; display: block; font-size: 8pt !important" id="premain1" class="small-text align-right" width="100%"><img style="overflow-x: auto; overflow-y: auto; cursor: pointer" id="preimg1" src="http://www.codeproject.com/images/minus.gif" width="9" height="9" preid="1" alt="" /><span style="margin-bottom: 0px; cursor: pointer" id="precollapse1" preid="1"><span id="hvzpftn" class="Apple-converted-space"> </span>Collapse</span></div><pre style="border-bottom: rgb(251,237,187) 1px solid; border-left: rgb(251,237,187) 1px solid; padding-bottom: 6px; overflow-x: auto; overflow-y: auto; background-color: rgb(251,237,187); margin-top: 0px; padding-left: 6px; padding-right: 6px; font: 9pt 'Courier New', Courier, mono; word-wrap: break-word; white-space: pre-wrap; border-top: rgb(251,237,187) 1px solid; border-right: rgb(251,237,187) 1px solid; padding-top: 6px" id="pre1" lang="cs"><span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">class</span> NormalSwitch : Switch { } <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">class</span> FancySwitch : Switch { }</pre> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">These two specific switch classes may have their own specific features and behaviours, but for now, let's keep them simple.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Cool. Now, what about fan and light?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Let me try. I learned from the Open Closed principles from Object Oriented Design principles that we should try to do abstractions whenever possible, right?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Right.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Unlike switches, fan and light are two different things. For switches, we were able to use a base<code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Switch</code><span id="hvzpftn" class="Apple-converted-space"> </span>class, but as fan and light are two different things, instead of defining a base class, an interface might be more appropriate. In general, they are all electrical equipments. So, we can define an interface, say,<code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">IElectricalEquipment</code>, for abstracting fans and lights, right?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Right.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: OK, each electrical equipment has some common functionality. They could all be turned on or off. So the interface may be as follows:</p> <div style="text-align: right !important; display: block; font-size: 8pt !important" id="premain2" class="small-text align-right" width="100%"><img style="overflow-x: auto; overflow-y: auto; cursor: pointer" id="preimg2" src="http://www.codeproject.com/images/minus.gif" width="9" height="9" preid="2" alt="" /><span style="margin-bottom: 0px; cursor: pointer" id="precollapse2" preid="2"><span id="hvzpftn" class="Apple-converted-space"> </span>Collapse</span></div><pre style="border-bottom: rgb(251,237,187) 1px solid; border-left: rgb(251,237,187) 1px solid; padding-bottom: 6px; overflow-x: auto; overflow-y: auto; background-color: rgb(251,237,187); margin-top: 0px; padding-left: 6px; padding-right: 6px; font: 9pt 'Courier New', Courier, mono; word-wrap: break-word; white-space: pre-wrap; border-top: rgb(251,237,187) 1px solid; border-right: rgb(251,237,187) 1px solid; padding-top: 6px" id="pre2" lang="cs"><span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">interface</span> IElectricalEquipment { <span style="color: blue" class="code-keyword">void</span> PowerOn(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">Each electrical equipment can be turned on </span> <span style="color: blue" class="code-keyword">void</span> PowerOff(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">Each electrical equipment can be turned off </span>}</pre> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Great. You are getting good at abstracting things. Now, we need a bridge. In real world, the wires are the bridges. But, in our object design, a switch knows how to turn on or off an electrical equipment, and the electrical equipment somehow needs to be connected with the switches, As we don't have any wire here, the only way to let the electrical equipment be connected with the switch is encapsulation.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Yes, but switches don't know the fans or lights directly. A switch actually knows about an electrical equipment<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">IElectricalEquipment</code><span id="hvzpftn" class="Apple-converted-space"> </span>that it can turn on or off. So, that means, an<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">ISwitch</code><span id="hvzpftn" class="Apple-converted-space"> </span>should have an<code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">IElectricalEquipment</code><span id="hvzpftn" class="Apple-converted-space"> </span>instance, right?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Right. Here, the encapsulated instance, which is an abstraction of fan or light (<code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">IElectricalEquipment</code>) is the bridge. So, let's modify the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Switch</code><span id="hvzpftn" class="Apple-converted-space"> </span>class to encapsulate an electrical equipment:</p> <div style="text-align: right !important; display: block; font-size: 8pt !important" id="premain3" class="small-text align-right" width="100%"><img style="overflow-x: auto; overflow-y: auto; cursor: pointer" id="preimg3" src="http://www.codeproject.com/images/minus.gif" width="9" height="9" preid="3" alt="" /><span style="margin-bottom: 0px; cursor: pointer" id="precollapse3" preid="3"><span id="hvzpftn" class="Apple-converted-space"> </span>Collapse</span></div><pre style="border-bottom: rgb(251,237,187) 1px solid; border-left: rgb(251,237,187) 1px solid; padding-bottom: 6px; overflow-x: auto; overflow-y: auto; background-color: rgb(251,237,187); margin-top: 0px; padding-left: 6px; padding-right: 6px; font: 9pt 'Courier New', Courier, mono; word-wrap: break-word; white-space: pre-wrap; border-top: rgb(251,237,187) 1px solid; border-right: rgb(251,237,187) 1px solid; padding-top: 6px" id="pre3" lang="cs"><span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">class</span> Switch { <span style="color: blue" class="code-keyword">public</span> IElectricalEquipment equipment { <span style="color: blue" class="code-keyword">get</span>; <span style="color: blue" class="code-keyword">set</span>; } <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> On() { <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">Switch has an on button </span> } <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> Off() { <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">Switch has an off button </span> } }</pre> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Understood. Let me try to define the actual electrical equipments, the fan and the light. As I see, these are electrical equipments in general, so these would simply implement the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">IElectricalEquipment</code>interface.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">Following is the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Fan</code><span id="hvzpftn" class="Apple-converted-space"> </span>class:</p> <div style="text-align: right !important; display: block; font-size: 8pt !important" id="premain4" class="small-text align-right" width="100%"><img style="overflow-x: auto; overflow-y: auto; cursor: pointer" id="preimg4" src="http://www.codeproject.com/images/minus.gif" width="9" height="9" preid="4" alt="" /><span style="margin-bottom: 0px; cursor: pointer" id="precollapse4" preid="4"><span id="hvzpftn" class="Apple-converted-space"> </span>Collapse</span></div><pre style="border-bottom: rgb(251,237,187) 1px solid; border-left: rgb(251,237,187) 1px solid; padding-bottom: 6px; overflow-x: auto; overflow-y: auto; background-color: rgb(251,237,187); margin-top: 0px; padding-left: 6px; padding-right: 6px; font: 9pt 'Courier New', Courier, mono; word-wrap: break-word; white-space: pre-wrap; border-top: rgb(251,237,187) 1px solid; border-right: rgb(251,237,187) 1px solid; padding-top: 6px" id="pre4" lang="cs"><span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">class</span> Fan : IElectricalEquipment { <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> PowerOn() { Console.WriteLine(<span style="color: purple" class="code-string">"</span><span style="color: purple" class="code-string">Fan is on"</span>); } <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> PowerOff() { Console.WriteLine(<span style="color: purple" class="code-string">"</span><span style="color: purple" class="code-string">Fan is off"</span>); } }</pre> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">And, the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Fan</code><span id="hvzpftn" class="Apple-converted-space"> </span>class would be as follows:</p> <div style="text-align: right !important; display: block; font-size: 8pt !important" id="premain5" class="small-text align-right" width="100%"><img style="overflow-x: auto; overflow-y: auto; cursor: pointer" id="preimg5" src="http://www.codeproject.com/images/minus.gif" width="9" height="9" preid="5" alt="" /><span style="margin-bottom: 0px; cursor: pointer" id="precollapse5" preid="5"><span id="hvzpftn" class="Apple-converted-space"> </span>Collapse</span></div><pre style="border-bottom: rgb(251,237,187) 1px solid; border-left: rgb(251,237,187) 1px solid; padding-bottom: 6px; overflow-x: auto; overflow-y: auto; background-color: rgb(251,237,187); margin-top: 0px; padding-left: 6px; padding-right: 6px; font: 9pt 'Courier New', Courier, mono; word-wrap: break-word; white-space: pre-wrap; border-top: rgb(251,237,187) 1px solid; border-right: rgb(251,237,187) 1px solid; padding-top: 6px" id="pre5" lang="cs"><span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">class</span> Light : IElectricalEquipment { <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> PowerOn() { Console.WriteLine(<span style="color: purple" class="code-string">"</span><span style="color: purple" class="code-string">Light is on"</span>); } <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> PowerOff() { Console.WriteLine(<span style="color: purple" class="code-string">"</span><span style="color: purple" class="code-string">Light is off"</span>); } }</pre> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Great. Now, let's make switches work. The switches should have the ability inside them to turn on and turn off the electrical equipment (it is connected to) when the switch is turned on and off.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">These are the key issues:</p> <ul><li style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">When the<span id="hvzpftn" class="Apple-converted-space"> </span><em>On聺</em><span id="hvzpftn" class="Apple-converted-space"> </span>button is pressed on the switch, the electrical equipment connected to it should be turned on.</li><li style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">When the<span id="hvzpftn" class="Apple-converted-space"> </span><em>Off</em><span id="hvzpftn" class="Apple-converted-space"> </span>button is pressed on the switch, the electrical equipment connected to it should be turned off.</li></ul> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">Basically, following is what we want to achieve:</p> <div style="text-align: right !important; display: block; font-size: 8pt !important" id="premain6" class="small-text align-right" width="100%"><img style="overflow-x: auto; overflow-y: auto; cursor: pointer" id="preimg6" src="http://www.codeproject.com/images/minus.gif" width="9" height="9" preid="6" alt="" /><span style="margin-bottom: 0px; cursor: pointer" id="precollapse6" preid="6"><span id="hvzpftn" class="Apple-converted-space"> </span>Collapse</span></div><pre style="border-bottom: rgb(251,237,187) 1px solid; border-left: rgb(251,237,187) 1px solid; padding-bottom: 6px; overflow-x: auto; overflow-y: auto; background-color: rgb(251,237,187); margin-top: 0px; padding-left: 6px; padding-right: 6px; font: 9pt 'Courier New', Courier, mono; word-wrap: break-word; white-space: pre-wrap; border-top: rgb(251,237,187) 1px solid; border-right: rgb(251,237,187) 1px solid; padding-top: 6px" id="pre6" lang="cs"><span style="color: blue" class="code-keyword">static</span> <span style="color: blue" class="code-keyword">void</span> Main(<span style="color: blue" class="code-keyword">string</span>[] args) { <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">We have some electrical equipments, say Fan, Light etc. </span> <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">So, lets create them first. </span> IElectricalEquipment fan = <span style="color: blue" class="code-keyword">new</span> Fan(); IElectricalEquipment light = <span style="color: blue" class="code-keyword">new</span> Light(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">We also have some switches. Lets create them too. </span> Switch fancySwitch = <span style="color: blue" class="code-keyword">new</span> FancySwitch(); Switch normalSwitch = <span style="color: blue" class="code-keyword">new</span> NormalSwitch(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">Lets connect the Fan to the fancy switch </span> fancySwitch.equipment = fan; <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">As the switch now has an equipment (Fan), </span> <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">so switching on or off should </span> <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">turn on or off the electrical equipment </span> fancySwitch.On(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">It should turn on the Fan. </span> <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">so, inside the On() method of Switch, </span> <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">we must turn on the electrical equipment. </span> <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">It should turn off the Fan. So, inside the On() method of </span> fancySwitch.Off(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">Switch, we must turn off the electrical equipment </span> <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">Now, lets plug the light to the fancy switch </span> fancySwitch.equipment = light; fancySwitch.On(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">It should turn on the Light now </span> fancySwitch.Off(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">It should be turn off the Light now </span>}</pre> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: I got it. So, the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">On()</code><span id="hvzpftn" class="Apple-converted-space"> </span>method of the actual switches should internally call the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">TurnOn()</code><span id="hvzpftn" class="Apple-converted-space"> </span>method of the electrical equipment, and the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Off()</code><span id="hvzpftn" class="Apple-converted-space"> </span>should call the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">TurnOff()</code><span id="hvzpftn" class="Apple-converted-space"> </span>method on the equipment. So, the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Switch</code>class should be as follows:</p> <div style="text-align: right !important; display: block; font-size: 8pt !important" id="premain7" class="small-text align-right" width="100%"><img style="overflow-x: auto; overflow-y: auto; cursor: pointer" id="preimg7" src="http://www.codeproject.com/images/minus.gif" width="9" height="9" preid="7" alt="" /><span style="margin-bottom: 0px; cursor: pointer" id="precollapse7" preid="7"><span id="hvzpftn" class="Apple-converted-space"> </span>Collapse</span></div><pre style="border-bottom: rgb(251,237,187) 1px solid; border-left: rgb(251,237,187) 1px solid; padding-bottom: 6px; overflow-x: auto; overflow-y: auto; background-color: rgb(251,237,187); margin-top: 0px; padding-left: 6px; padding-right: 6px; font: 9pt 'Courier New', Courier, mono; word-wrap: break-word; white-space: pre-wrap; border-top: rgb(251,237,187) 1px solid; border-right: rgb(251,237,187) 1px solid; padding-top: 6px" id="pre7" lang="cs"><span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">class</span> Switch { <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> On() { Console.WriteLine(<span style="color: purple" class="code-string">"</span><span style="color: purple" class="code-string">Switch on the equipment"</span>); equipment.PowerOn(); } <span style="color: blue" class="code-keyword">public</span> <span style="color: blue" class="code-keyword">void</span> Off() { Console.WriteLine(<span style="color: purple" class="code-string">"</span><span style="color: purple" class="code-string">Switch off the equipment"</span>); equipment.PowerOff(); } }</pre> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: Great work. Now, this certainly allows you to plug a fan from one switch to another. But you see, the opposite should also work. That means, you can change the switch of a fan or light without touching the fan or light. For example, you can easily change the switch of the light from<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">FancySwitch</code><span id="hvzpftn" class="Apple-converted-space"> </span>to<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">NormalSwitch</code><span id="hvzpftn" class="Apple-converted-space"> </span>as follows:</p> <div style="text-align: right !important; display: block; font-size: 8pt !important" id="premain8" class="small-text align-right" width="100%"><img style="overflow-x: auto; overflow-y: auto; cursor: pointer" id="preimg8" src="http://www.codeproject.com/images/minus.gif" width="9" height="9" preid="8" alt="" /><span style="margin-bottom: 0px; cursor: pointer" id="precollapse8" preid="8"><span id="hvzpftn" class="Apple-converted-space"> </span>Collapse</span></div><pre style="border-bottom: rgb(251,237,187) 1px solid; border-left: rgb(251,237,187) 1px solid; padding-bottom: 6px; overflow-x: auto; overflow-y: auto; background-color: rgb(251,237,187); margin-top: 0px; padding-left: 6px; padding-right: 6px; font: 9pt 'Courier New', Courier, mono; word-wrap: break-word; white-space: pre-wrap; border-top: rgb(251,237,187) 1px solid; border-right: rgb(251,237,187) 1px solid; padding-top: 6px" id="pre8" lang="cs">normalSwitch .equipment = light; normalSwitch.On(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">It should turn on the Light now </span>normalSwitch.Off(); <span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">//</span><span style="font-style: italic; color: rgb(0,128,0)" class="code-comment">It should be turn off the Light now</span></pre> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">So, you see, you can vary both the switches and the electrical equipments without any effect on the other, and connecting an abstraction of the electrical equipment with a switch (via encapsulation) is letting you do that. This design looks elegant and good. The Gang of Four has named this a pattern: The Bridge Pattern.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Cool. I think I've understood the idea. Basically, two systems shouldn't be connected or dependent on another directly. Rather, they should be connected or dependent via abstraction (as the Dependency Inversion principle and the Open-Closed principle say) so that they are loosely coupled, and thus we are able to change our implementation when required without much effect on the other part of the system.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: You got it perfect darling. Let's see how the Bridge Pattern is defined:</p> <h2 style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; color: rgb(255,153,0); font-size: 13pt; font-weight: bold">"Decouple an abstraction from its implementation so that the two can vary independently"</h2> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">You will see that our design perfectly matches the definition. If you have a class designer (in Visual Studio, you can do that, and other modern IDEs should also support this feature), you will see that you have a class diagram similar to the following:</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><img style="overflow-x: auto; overflow-y: auto" src="http://www.codeproject.com/KB/architecture/LearningDesignPatterns1/bridge.gif" width="448" height="293" complete="true" alt="" /></p> <div style="font-style: italic; font-size: 8pt; font-weight: bold" class="Caption">Class diagram of Bridge pattern.</div> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">Here,<span id="hvzpftn" class="Apple-converted-space"> </span><strong>Abstraction</strong><span id="hvzpftn" class="Apple-converted-space"> </span>is the base<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Switch</code><span id="hvzpftn" class="Apple-converted-space"> </span>class.<span id="hvzpftn" class="Apple-converted-space"> </span><strong>RefinedAbstraction</strong><span id="hvzpftn" class="Apple-converted-space"> </span>is the specific switch classes (<code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">FancySwitch</code>,<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">NormalSwitch</code><span id="hvzpftn" class="Apple-converted-space"> </span>etc.).<span id="hvzpftn" class="Apple-converted-space"> </span><strong>Implementor</strong><span id="hvzpftn" class="Apple-converted-space"> </span>is the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">IElectricalEquipment</code><span id="hvzpftn" class="Apple-converted-space"> </span>interface.<strong>ConcreteImplementorA</strong><span id="hvzpftn" class="Apple-converted-space"> </span>and<span id="hvzpftn" class="Apple-converted-space"> </span><strong>ConcreteImplementorB</strong><span id="hvzpftn" class="Apple-converted-space"> </span>are the<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Fan</code><span id="hvzpftn" class="Apple-converted-space"> </span>and<span id="hvzpftn" class="Apple-converted-space"> </span><code style="font: 11pt 'Courier New', Courier, mono; color: rgb(153,0,0)">Light</code><span id="hvzpftn" class="Apple-converted-space"> </span>classes.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Let me ask you a question, just curious. There are many other patterns as you said, why did you start with the Bridge pattern? Any important reason?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: A very good question. Yes, I started with the Bridge pattern and not any other pattern (unlike many others) because of a reason. I believe the Bridge pattern is the base of all Object Oriented Design Patterns. You see:</p> <ul><li style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">It teaches how to think abstract, which is the key concept of all Object Oriented Design Patterns.</li><li style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">It implements the basic OOD principles.</li><li style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">It is easy to understand.</li><li style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt">If this pattern is understood correctly, learning other Design Patterns becomes easy.</li></ul> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: Do you think I have understood it correctly?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: I think you have understood it perfectly darling.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: So, what's next?</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Shubho</strong>: By understanding the Bridge pattern, we have just started to understand the concepts of Design Patterns. In our next conversation, we would learn other Design Patterns, and I hope you won't get bored learning them.</p> <p style="line-height: 1.2em; font-family: Verdana, Arial, sans-serif; font-size: 10pt"><strong>Farhana</strong>: I won't. Believe me.<br /><br />from:<br /><a >http://www.codeproject.com/KB/architecture/LearningDesignPatterns1.aspx</a></p></span></span><img src ="http://m.shnenglu.com/beautykingdom/aggbug/148264.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/beautykingdom/" target="_blank">chatler</a> 2011-06-08 14:14 <a href="http://m.shnenglu.com/beautykingdom/archive/2011/06/08/148264.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>How to explain OOD to my wife-code project銆婅漿杞姐?/title><link>http://m.shnenglu.com/beautykingdom/archive/2011/06/08/148263.html</link><dc:creator>chatler</dc:creator><author>chatler</author><pubDate>Wed, 08 Jun 2011 05:45:00 GMT</pubDate><guid>http://m.shnenglu.com/beautykingdom/archive/2011/06/08/148263.html</guid><wfw:comment>http://m.shnenglu.com/beautykingdom/comments/148263.html</wfw:comment><comments>http://m.shnenglu.com/beautykingdom/archive/2011/06/08/148263.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/beautykingdom/comments/commentRss/148263.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/beautykingdom/services/trackbacks/148263.html</trackback:ping><description><![CDATA[     鎽樿: Introduction My wife Farhana wants to resume her career as a software developer (she started her career as a software developer, but couldn't proceed much because of our first child's birth), and the...  <a href='http://m.shnenglu.com/beautykingdom/archive/2011/06/08/148263.html'>闃呰鍏ㄦ枃</a><img src ="http://m.shnenglu.com/beautykingdom/aggbug/148263.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/beautykingdom/" target="_blank">chatler</a> 2011-06-08 13:45 <a href="http://m.shnenglu.com/beautykingdom/archive/2011/06/08/148263.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>榪組M涓庤璁℃ā寮忕殑鏈夎叮瑙佽Вhttp://m.shnenglu.com/beautykingdom/archive/2009/12/05/102587.htmlchatlerchatlerSat, 05 Dec 2009 02:43:00 GMThttp://m.shnenglu.com/beautykingdom/archive/2009/12/05/102587.htmlhttp://m.shnenglu.com/beautykingdom/comments/102587.htmlhttp://m.shnenglu.com/beautykingdom/archive/2009/12/05/102587.html#Feedback0http://m.shnenglu.com/beautykingdom/comments/commentRss/102587.htmlhttp://m.shnenglu.com/beautykingdom/services/trackbacks/102587.html鍒涘緩鍨嬫ā寮?

1
銆?span>FACTORY 鈥?/span>榪?span>MM灝戜笉浜嗚鍚冮キ浜嗭紝楹﹀綋鍔崇殑楦$繀鍜岃偗寰峰熀鐨勯浮緲呴兘鏄?span>MM鐖卞悆鐨勪笢瑗匡紝铏界劧鍙e懗鏈夋墍涓嶅悓錛屼絾涓嶇浣犲甫MM鍘婚害褰撳姵鎴栬偗寰峰熀錛屽彧綆″悜鏈嶅姟鍛樿鏉ュ洓涓浮緲?span>”灝辮浜嗐傞害褰撳姵鍜岃偗寰峰熀灝辨槸鐢熶駭楦$繀鐨?span>Factory

宸ュ巶妯″紡錛氬鎴風被鍜屽伐鍘傜被鍒嗗紑銆傛秷璐硅呬換浣曟椂鍊欓渶瑕佹煇縐嶄駭鍝侊紝鍙渶鍚戝伐鍘傝姹傚嵆鍙傛秷璐硅呮棤欏諱慨鏀瑰氨鍙互鎺ョ撼鏂頒駭鍝併傜己鐐規槸褰撲駭鍝佷慨鏀規椂錛屽伐鍘傜被涔熻鍋氱浉搴旂殑淇敼銆傚錛氬浣曞垱寤哄強濡備綍鍚戝鎴風鎻愪緵銆?

2
銆?span>BUILDER 鈥擬M鏈鐖卞惉鐨勫氨鏄?span>“鎴戠埍浣?span>”榪欏彞璇濅簡錛岃鍒頒笉鍚屽湴鏂圭殑MM,瑕佽兘澶熺敤濂逛滑鐨勬柟璦璺熷ス璇磋繖鍙ヨ瘽鍝︼紝鎴戞湁涓涓縐嶈璦緲昏瘧鏈猴紝涓婇潰姣忕璇█閮芥湁涓涓寜閿紝瑙佸埌MM鎴戝彧瑕佹寜瀵瑰簲鐨勯敭錛屽畠灝辮兘澶熺敤鐩稿簲鐨勮璦璇村嚭鎴戠埍浣?span>”榪欏彞璇濅簡錛屽浗澶栫殑MM涔熷彲浠ヨ交鏉炬悶鎺傦紝榪欏氨鏄垜鐨?span>“鎴戠埍浣?span>”builder銆傦紙榪欎竴瀹氭瘮緹庡啗鍦ㄤ紛鎷夊厠鐢ㄧ殑緲昏瘧鏈哄ソ鍗栵級

寤洪犳ā寮?/span>錛氬皢浜у搧鐨勫唴閮ㄨ〃璞″拰浜у搧鐨勭敓鎴愯繃紼嬪垎鍓插紑鏉ワ紝浠庤屼嬌涓涓緩閫犺繃紼嬬敓鎴愬叿鏈変笉鍚岀殑鍐呴儴琛ㄨ薄鐨勪駭鍝佸璞°傚緩閫犳ā寮忎嬌寰椾駭鍝佸唴閮ㄨ〃璞″彲浠ョ嫭绔嬬殑鍙樺寲錛屽鎴蜂笉蹇呯煡閬撲駭鍝佸唴閮ㄧ粍鎴愮殑緇嗚妭銆傚緩閫犳ā寮忓彲浠ュ己鍒跺疄琛屼竴縐嶅垎姝ラ榪涜鐨勫緩閫犺繃紼嬨?

3
銆?span>FACTORY METHOD 鈥?/span>璇?span>MM鍘婚害褰撳姵鍚冩眽鍫★紝涓嶅悓鐨?span>MM鏈変笉鍚岀殑鍙e懗錛岃姣忎釜閮借浣忔槸涓浠剁儲浜虹殑浜嬫儏錛屾垜涓鑸噰鐢?span>Factory Method妯″紡錛屽甫鐫MM鍒版湇鍔″憳閭e効錛岃瑕佷竴涓眽鍫?span>”錛屽叿浣撹浠涔堟牱鐨勬眽鍫″憿錛岃MM鐩存帴璺熸湇鍔″憳璇村氨琛屼簡銆?

宸ュ巶鏂規硶妯″紡錛氭牳蹇冨伐鍘傜被涓嶅啀璐熻矗鎵鏈変駭鍝佺殑鍒涘緩錛岃屾槸灝嗗叿浣撳垱寤虹殑宸ヤ綔浜ょ粰瀛愮被鍘誨仛錛屾垚涓轟竴涓娊璞″伐鍘傝鑹詫紝浠呰礋璐g粰鍑哄叿浣撳伐鍘傜被蹇呴』瀹炵幇鐨勬帴鍙o紝鑰屼笉鎺ヨЕ鍝竴涓駭鍝佺被搴斿綋琚疄渚嬪寲榪欑緇嗚妭銆?

4
銆?span>PROTOTYPE 鈥?/span>璺?span>MM鐢?span>QQ鑱婂ぉ錛屼竴瀹氳璇翠簺娣辨儏鐨勮瘽璇簡錛屾垜鎼滈泦浜嗗ソ澶氳倝楹葷殑鎯呰瘽錛岄渶瑕佹椂鍙copy鍑烘潵鏀懼埌QQ閲岄潰灝辮浜嗭紝榪欏氨鏄垜鐨勬儏璇?span>prototype浜嗐傦紙100鍧楅挶涓浠斤紝浣犺涓嶈錛?

鍘熷妯″瀷妯″紡錛氶氳繃緇欏嚭涓涓師鍨嬪璞℃潵鎸囨槑鎵瑕佸垱寤虹殑瀵硅薄鐨勭被鍨嬶紝鐒跺悗鐢ㄥ鍒惰繖涓師鍨嬪璞$殑鏂規硶鍒涘緩鍑烘洿澶氬悓綾誨瀷鐨勫璞°傚師濮嬫ā鍨嬫ā寮忓厑璁稿姩鎬佺殑澧炲姞鎴栧噺灝戜駭鍝佺被錛屼駭鍝佺被涓嶉渶瑕侀潪寰楁湁浠諱綍浜嬪厛紜畾鐨勭瓑綰х粨鏋勶紝鍘熷妯″瀷妯″紡閫傜敤浜庝換浣曠殑絳夌駭緇撴瀯銆傜己鐐規槸姣忎竴涓被閮藉繀欏婚厤澶囦竴涓厠闅嗘柟娉曘?

5
銆?span>SINGLETON 鈥?/span>淇烘湁6涓紓浜殑鑰佸﹩錛屽ス浠殑鑰佸叕閮芥槸鎴戯紝鎴戝氨鏄垜浠閲岀殑鑰佸叕Sigleton錛屽ス浠彧瑕佽閬?span>“鑰佸叕錛岄兘鏄寚鐨勫悓涓涓漢錛岄偅灝辨槸鎴?span>(鍒氭墠鍋氫簡涓ⅵ鍟︼紝鍝湁榪欎箞濂界殑浜?span>)

鍗曚緥妯″紡錛氬崟渚嬫ā寮忕‘淇濇煇涓涓被鍙湁涓涓疄渚嬶紝鑰屼笖鑷瀹炰緥鍖栧茍鍚戞暣涓郴緇熸彁渚涜繖涓疄渚嬪崟渚嬫ā寮忋傚崟渚嬫ā寮忓彧搴斿湪鏈夌湡姝g殑鍗曚竴瀹炰緥鐨勯渶姹傛椂鎵嶅彲浣跨敤銆?

緇撴瀯鍨嬫ā寮?

6
銆?span>ADAPTER 鈥?/span>鍦ㄦ湅鍙嬭仛浼氫笂紕板埌浜嗕竴涓編濂?span>Sarah錛屼粠棣欐腐鏉ョ殑錛屽彲鎴戜笉浼氳綺よ錛屽ス涓嶄細璇存櫘閫氳瘽錛屽彧濂芥眰鍔╀簬鎴戠殑鏈嬪弸kent浜嗭紝浠栦綔涓烘垜鍜?span>Sarah涔嬮棿鐨?span>Adapter錛岃鎴戝拰Sarah鍙互鐩鎬簰浜よ皥浜?span>(涔熶笉鐭ラ亾浠栦細涓嶄細鑰嶆垜)

閫傞厤鍣ㄦā寮?/span>錛氭妸涓涓被鐨勬帴鍙e彉鎹㈡垚瀹㈡埛绔墍鏈熷緟鐨勫彟涓縐嶆帴鍙o紝浠庤屼嬌鍘熸湰鍥犳帴鍙e師鍥犱笉鍖歸厤鑰屾棤娉曚竴璧峰伐浣滅殑涓や釜綾昏兘澶熶竴璧峰伐浣溿傞傞厤綾誨彲浠ユ牴鎹弬鏁拌繑榪樹竴涓悎閫傜殑瀹炰緥緇欏鎴風銆?

7
銆?span>BRIDGE 鈥?/span>鏃╀笂紕板埌MM錛岃璇存棭涓婂ソ錛屾櫄涓婄鍒?span>MM錛岃璇存櫄涓婂ソ錛涚鍒?span>MM絀夸簡浠舵柊琛f湇錛岃璇翠綘鐨勮。鏈嶅ソ婕備寒鍝︼紝紕板埌MM鏂板仛鐨勫彂鍨嬶紝瑕佽浣犵殑澶村彂濂芥紓浜摝銆備笉瑕侀棶鎴?span>“鏃╀笂紕板埌MM鏂板仛浜嗕釜鍙戝瀷鎬庝箞璇?span>”榪欑闂錛岃嚜宸辯敤BRIDGE緇勫悎涓涓嬩笉灝辮浜?

妗ユ妯″紡錛氬皢鎶借薄鍖栦笌瀹炵幇鍖栬劚鑰︼紝浣垮緱浜岃呭彲浠ョ嫭绔嬬殑鍙樺寲錛屼篃灝辨槸璇村皢浠栦滑涔嬮棿鐨勫己鍏寵仈鍙樻垚寮卞叧鑱旓紝涔熷氨鏄寚鍦ㄤ竴涓蔣浠剁郴緇熺殑鎶借薄鍖栧拰瀹炵幇鍖栦箣闂翠嬌鐢ㄧ粍鍚?span>/鑱氬悎鍏崇郴鑰屼笉鏄戶鎵垮叧緋伙紝浠庤屼嬌涓よ呭彲浠ョ嫭绔嬬殑鍙樺寲銆?

8
銆?span>COMPOSITE 鈥擬ary浠婂ぉ榪囩敓鏃ャ?span>“鎴戣繃鐢熸棩錛屼綘瑕侀佹垜涓浠剁ぜ鐗┿?span>”“鍡紝濂藉惂錛屽幓鍟嗗簵錛屼綘鑷繁鎸戙?span>”“榪欎歡T鎭ゆ尯婕備寒錛屼拱錛岃繖鏉¤瀛愬ソ鐪嬶紝涔幫紝榪欎釜鍖呬篃涓嶉敊錛屼拱銆?span>”“鍠傦紝涔頒簡涓変歡浜嗗憖錛屾垜鍙瓟搴旈佷竴浠剁ぜ鐗╃殑鍝︺?span>”“浠涔堝憖錛?span>T鎭ゅ姞瑁欏瓙鍔犲寘鍖咃紝姝eソ閰嶆垚涓濂楀憖錛屽皬濮愶紝楹葷儲浣犲寘璧鋒潵銆?span>”“……”錛?span>MM閮戒細鐢?span>Composite妯″紡浜嗭紝浣犱細浜嗘病鏈夛紵

鍚堟垚妯″紡錛氬悎鎴愭ā寮忓皢瀵硅薄緇勭粐鍒版爲緇撴瀯涓紝鍙互鐢ㄦ潵鎻忚堪鏁翠綋涓庨儴鍒嗙殑鍏崇郴銆傚悎鎴愭ā寮忓氨鏄竴涓鐞嗗璞$殑鏍戠粨鏋勭殑妯″紡銆傚悎鎴愭ā寮忔妸閮ㄥ垎涓庢暣浣撶殑鍏崇郴鐢ㄦ爲緇撴瀯琛ㄧず鍑烘潵銆傚悎鎴愭ā寮忎嬌寰楀鎴風鎶婁竴涓釜鍗曠嫭鐨勬垚鍒嗗璞″拰鐢變粬浠鍚堣屾垚鐨勫悎鎴愬璞″悓絳夌湅寰呫?

9
銆?span>DECORATOR 鈥擬ary榪囧畬杞埌Sarly榪囩敓鏃ワ紝榪樻槸涓嶈鍙ス鑷繁鎸戜簡錛屼笉鐒惰繖涓湀浼欓璐硅偗瀹氱帺瀹岋紝鎷垮嚭鎴戝幓騫村湪鍗庡北欏朵笂鐓х殑鐓х墖錛屽湪鑳岄潰鍐欎笂鏈濂界殑鐨勭ぜ鐗╋紝灝辨槸鐖變綘鐨?span>Fita”錛屽啀鍒拌涓婄ぜ鍝佸簵涔頒簡涓儚妗嗭紙鍗栫ぜ鍝佺殑MM涔熷緢婕備寒鍝︼級錛屽啀鎵鵑殧澹佹悶緹庢湳璁捐鐨?span>Mike璁捐浜嗕竴涓紓浜殑鐩掑瓙瑁呰搗鏉?span>……錛屾垜浠兘鏄?span>Decorator錛屾渶緇堥兘鍦ㄤ慨楗版垜榪欎釜浜哄憖錛屾庝箞鏍鳳紝鐪嬫噦浜嗗悧錛?

瑁呴グ妯″紡錛氳楗版ā寮忎互瀵瑰鎴風閫忔槑鐨勬柟寮忔墿灞曞璞$殑鍔熻兘錛屾槸緇ф壙鍏崇郴鐨勪竴涓浛浠f柟妗堬紝鎻愪緵姣旂戶鎵挎洿澶氱殑鐏墊椿鎬с傚姩鎬佺粰涓涓璞″鍔犲姛鑳斤紝榪欎簺鍔熻兘鍙互鍐嶅姩鎬佺殑鎾ゆ秷銆傚鍔犵敱涓浜涘熀鏈姛鑳界殑鎺掑垪緇勫悎鑰屼駭鐢熺殑闈炲父澶ч噺鐨勫姛鑳姐?

10
銆?span>FAÇADE 鈥?/span>鎴戞湁涓涓笓涓氱殑Nikon鐩告満錛屾垜灝卞枩嬈㈣嚜宸辨墜鍔ㄨ皟鍏夊湀銆佸揩闂紝榪欐牱鐓у嚭鏉ョ殑鐓х墖鎵嶄笓涓氾紝浣?span>MM鍙笉鎳傝繖浜涳紝鏁欎簡鍗婂ぉ涔熶笉浼氥傚垢濂界浉鏈烘湁Facade璁捐妯″紡錛屾妸鐩告満璋冩暣鍒拌嚜鍔ㄦ。錛屽彧瑕佸鍑嗙洰鏍囨寜蹇棬灝辮浜嗭紝涓鍒囩敱鐩告満鑷姩璋冩暣錛岃繖鏍?span>MM涔熷彲浠ョ敤榪欎釜鐩告満緇欐垜鎷嶅紶鐓х墖浜嗐?

闂ㄩ潰妯″紡錛氬閮ㄤ笌涓涓瓙緋葷粺鐨勯氫俊蹇呴』閫氳繃涓涓粺涓鐨勯棬闈㈠璞¤繘琛屻傞棬闈㈡ā寮忔彁渚涗竴涓珮灞傛鐨勬帴鍙o紝浣垮緱瀛愮郴緇熸洿鏄撲簬浣跨敤銆傛瘡涓涓瓙緋葷粺鍙湁涓涓棬闈㈢被錛岃屼笖姝ら棬闈㈢被鍙湁涓涓疄渚嬶紝涔熷氨鏄瀹冩槸涓涓崟渚嬫ā寮忋備絾鏁翠釜緋葷粺鍙互鏈夊涓棬闈㈢被銆?

11
銆?span>FLYWEIGHT 鈥?/span>姣忓ぉ璺?span>MM鍙戠煭淇★紝鎵嬫寚閮界瘡姝諱簡錛屾渶榪戜拱浜嗕釜鏂版墜鏈猴紝鍙互鎶婁竴浜涘父鐢ㄧ殑鍙ュ瓙瀛樺湪鎵嬫満閲岋紝瑕佺敤鐨勬椂鍊欙紝鐩存帴鎷垮嚭鏉ワ紝鍦ㄥ墠闈㈠姞涓?span>MM鐨勫悕瀛楀氨鍙互鍙戦佷簡錛屽啀涓嶇敤涓涓瓧涓涓瓧鏁蹭簡銆傚叡浜殑鍙ュ瓙灝辨槸Flyweight錛?span>MM鐨勫悕瀛楀氨鏄彁鍙栧嚭鏉ョ殑澶栭儴鐗瑰緛錛屾牴鎹笂涓嬫枃鎯呭喌浣跨敤銆?

浜厓妯″紡錛?span>FLYWEIGHT鍦ㄦ嫵鍑繪瘮璧涗腑鎸囨渶杞婚噺綰с備韓鍏冩ā寮忎互鍏變韓鐨勬柟寮忛珮鏁堢殑鏀寔澶ч噺鐨勭粏綺掑害瀵硅薄銆備韓鍏冩ā寮忚兘鍋氬埌鍏變韓鐨勫叧閿槸鍖哄垎鍐呰暣鐘舵佸拰澶栬暣鐘舵併傚唴钑寸姸鎬佸瓨鍌ㄥ湪浜厓鍐呴儴錛屼笉浼氶殢鐜鐨勬敼鍙樿屾湁鎵涓嶅悓銆傚钑寸姸鎬佹槸闅忕幆澧冪殑鏀瑰彉鑰屾敼鍙樼殑銆傚钑寸姸鎬佷笉鑳藉獎鍝嶅唴钑寸姸鎬侊紝瀹冧滑鏄浉浜掔嫭绔嬬殑銆傚皢鍙互鍏變韓鐨勭姸鎬佸拰涓嶅彲浠ュ叡浜殑鐘舵佷粠甯歌綾諱腑鍖哄垎寮鏉ワ紝灝嗕笉鍙互鍏變韓鐨勭姸鎬佷粠綾婚噷鍓旈櫎鍑哄幓銆傚鎴風涓嶅彲浠ョ洿鎺ュ垱寤鴻鍏變韓鐨勫璞★紝鑰屽簲褰撲嬌鐢ㄤ竴涓伐鍘傚璞¤礋璐e垱寤鴻鍏變韓鐨勫璞°備韓鍏冩ā寮忓ぇ騫呭害鐨勯檷浣庡唴瀛樹腑瀵硅薄鐨勬暟閲忋?

12
銆?span>PROXY 鈥?/span>璺?span>MM鍦ㄧ綉涓婅亰澶╋紝涓寮澶存繪槸“hi,浣犲ソ”,“浣犱粠鍝効鏉ュ憖錛?span>”“浣犲澶т簡錛?span>”“韜珮澶氬皯鍛錛?span>”榪欎簺璇濓紝鐪熺儲浜猴紝鍐欎釜紼嬪簭鍋氫負鎴戠殑Proxy鍚э紝鍑℃槸鎺ユ敹鍒拌繖浜涜瘽閮借緗ソ浜嗚嚜鍔ㄧ殑鍥炵瓟錛屾帴鏀跺埌鍏朵粬鐨勮瘽鏃跺啀閫氱煡鎴戝洖絳旓紝鎬庝箞鏍鳳紝閰峰惂銆?

浠g悊妯″紡錛氫唬鐞嗘ā寮忕粰鏌愪竴涓璞℃彁渚涗竴涓唬鐞嗗璞★紝騫剁敱浠g悊瀵硅薄鎺у埗瀵規簮瀵硅薄鐨勫紩鐢ㄣ備唬鐞嗗氨鏄竴涓漢鎴栦竴涓満鏋勪唬琛ㄥ彟涓涓漢鎴栬呬竴涓満鏋勯噰鍙栬鍔ㄣ傛煇浜涙儏鍐典笅錛屽鎴蜂笉鎯蟲垨鑰呬笉鑳藉鐩存帴寮曠敤涓涓璞★紝浠g悊瀵硅薄鍙互鍦ㄥ鎴峰拰鐩爣瀵硅薄鐩存帴璧峰埌涓粙鐨勪綔鐢ㄣ傚鎴風鍒嗚鯨涓嶅嚭浠g悊涓婚瀵硅薄涓庣湡瀹炰富棰樺璞°備唬鐞嗘ā寮忓彲浠ュ茍涓嶇煡閬撶湡姝g殑琚唬鐞嗗璞★紝鑰屼粎浠呮寔鏈変竴涓浠g悊瀵硅薄鐨勬帴鍙o紝榪欐椂鍊欎唬鐞嗗璞′笉鑳藉鍒涘緩琚唬鐞嗗璞★紝琚唬鐞嗗璞″繀欏繪湁緋葷粺鐨勫叾浠栬鑹蹭唬涓哄垱寤哄茍浼犲叆銆?

琛屼負妯″紡

13
銆?span>CHAIN OF RESPONSIBLEITY 鈥?/span>鏅氫笂鍘諱笂鑻辮璇撅紝涓轟簡濂藉紑婧滃潗鍒頒簡鏈鍚庝竴鎺掞紝鍝囷紝鍓嶉潰鍧愪簡濂藉嚑涓紓浜殑MM鍝庯紝鎵懼紶綰告潯錛屽啓涓?span>“Hi,鍙互鍋氭垜鐨勫コ鏈嬪弸鍚楋紵濡傛灉涓嶆効鎰忚鍚戝墠浼?span>”錛岀焊鏉″氨涓涓帴涓涓殑浼犱笂鍘諱簡錛岀碂緋曪紝浼犲埌絎竴鎺掔殑MM鎶婄焊鏉′紶緇欒佸笀浜嗭紝鍚鏄釜鑰佸濂沖憖錛屽揩璺?span>!

璐d換閾炬ā寮?/span>錛氬湪璐d換閾炬ā寮忎腑錛屽緢澶氬璞$敱姣忎竴涓璞″鍏朵笅瀹剁殑寮曠敤鑰屾帴璧鋒潵褰㈡垚涓鏉¢摼銆傝姹傚湪榪欎釜閾句笂浼犻掞紝鐩村埌閾句笂鐨勬煇涓涓璞″喅瀹氬鐞嗘璇鋒眰銆傚鎴峰茍涓嶇煡閬撻摼涓婄殑鍝竴涓璞℃渶緇堝鐞嗚繖涓姹傦紝緋葷粺鍙互鍦ㄤ笉褰卞搷瀹㈡埛绔殑鎯呭喌涓嬪姩鎬佺殑閲嶆柊緇勭粐閾懼拰鍒嗛厤璐d換銆傚鐞嗚呮湁涓や釜閫夋嫨錛氭壙鎷呰矗浠繪垨鑰呮妸璐d換鎺ㄧ粰涓嬪銆備竴涓姹傚彲浠ユ渶緇堜笉琚換浣曟帴鏀剁瀵硅薄鎵鎺ュ彈銆?

14
銆?span>COMMAND 鈥?/span>淇烘湁涓涓?span>MM瀹墮噷綆″緱鐗瑰埆涓ワ紝娌℃硶瑙侀潰錛屽彧濂藉熷姪浜庡ス寮熷紵鍦ㄦ垜浠咯涔嬮棿浼犻佷俊鎭紝濂瑰鎴戞湁浠涔堟寚紺猴紝灝卞啓涓寮犵焊鏉¤濂瑰紵寮熷甫緇欐垜銆傝繖涓嶏紝濂瑰紵寮熷張浼犻佽繃鏉ヤ竴涓?span>COMMAND錛屼負浜嗘劅璋粬錛屾垜璇蜂粬鍚冧簡紕楁潅閰遍潰錛屽摢鐭ラ亾浠栬錛?span>“鎴戝悓鏃剁粰鎴戝濮愪笁涓敺鏈嬪弸閫?span>COMMAND錛屽氨鏁頒綘鏈灝忔皵錛屾墠璇鋒垜鍚冮潰銆?span>”錛?/span>

鍛戒護妯″紡錛氬懡浠ゆā寮忔妸涓涓姹傛垨鑰呮搷浣滃皝瑁呭埌涓涓璞′腑銆傚懡浠ゆā寮忔妸鍙戝嚭鍛戒護鐨勮矗浠誨拰鎵ц鍛戒護鐨勮矗浠誨垎鍓插紑錛屽媧劇粰涓嶅悓鐨勫璞°傚懡浠ゆā寮忓厑璁歌姹傜殑涓鏂瑰拰鍙戦佺殑涓鏂圭嫭绔嬪紑鏉ワ紝浣垮緱璇鋒眰鐨勪竴鏂逛笉蹇呯煡閬撴帴鏀惰姹傜殑涓鏂圭殑鎺ュ彛錛屾洿涓嶅繀鐭ラ亾璇鋒眰鏄庝箞琚帴鏀訛紝浠ュ強鎿嶄綔鏄惁鎵ц錛屼綍鏃惰鎵ц浠ュ強鏄庝箞琚墽琛岀殑銆傜郴緇熸敮鎸佸懡浠ょ殑鎾ゆ秷銆?

15
銆?span>INTERPRETER 鈥?/span>淇烘湁涓涓婃場MM鐪熺粡銆嬶紝涓婇潰鏈夊悇縐嶆場MM鐨勬敾鐣ワ紝姣斿璇村幓鍚冭タ槨愮殑姝ラ銆佸幓鐪嬬數褰辯殑鏂規硶絳夌瓑錛岃窡MM綰︿細鏃訛紝鍙鍋氫竴涓?span>Interpreter錛岀収鐫涓婇潰鐨勮剼鏈墽琛屽氨鍙互浜嗐?

瑙i噴鍣ㄦā寮?/span>錛氱粰瀹氫竴涓璦鍚庯紝瑙i噴鍣ㄦā寮忓彲浠ュ畾涔夊嚭鍏舵枃娉曠殑涓縐嶈〃紺猴紝騫跺悓鏃舵彁渚涗竴涓В閲婂櫒銆傚鎴風鍙互浣跨敤榪欎釜瑙i噴鍣ㄦ潵瑙i噴榪欎釜璇█涓殑鍙ュ瓙銆傝В閲婂櫒妯″紡灝嗘弿榪版庢牱鍦ㄦ湁浜嗕竴涓畝鍗曠殑鏂囨硶鍚庯紝浣跨敤妯″紡璁捐瑙i噴榪欎簺璇彞銆傚湪瑙i噴鍣ㄦā寮忛噷闈㈡彁鍒扮殑璇█鏄寚浠諱綍瑙i噴鍣ㄥ璞¤兘澶熻В閲婄殑浠諱綍緇勫悎銆傚湪瑙i噴鍣ㄦā寮忎腑闇瑕佸畾涔変竴涓唬琛ㄦ枃娉曠殑鍛戒護綾葷殑絳夌駭緇撴瀯錛屼篃灝辨槸涓緋誨垪鐨勭粍鍚堣鍒欍傛瘡涓涓懡浠ゅ璞¢兘鏈変竴涓В閲婃柟娉曪紝浠h〃瀵瑰懡浠ゅ璞$殑瑙i噴銆傚懡浠ゅ璞$殑絳夌駭緇撴瀯涓殑瀵硅薄鐨勪換浣曟帓鍒楃粍鍚堥兘鏄竴涓璦銆?

16
銆?span>ITERATOR 鈥?/span>鎴戠埍涓婁簡Mary錛屼笉欏句竴鍒囩殑鍚戝ス姹傚銆?
   Mary
錛?span>“鎯寵鎴戣窡浣犵粨濠氾紝寰楃瓟搴旀垜鐨勬潯浠?span>”

  
鎴戯細浠涔堟潯浠舵垜閮界瓟搴旓紝浣犺鍚?span>”
   Mary
錛?span>“鎴戠湅涓婁簡閭d釜涓鍏嬫媺鐨勯捇鐭?span>”
  
鎴戯細鎴戜拱錛屾垜涔幫紝榪樻湁鍚楋紵
   Mary
錛?span>“鎴戠湅涓婁簡婀栬竟鐨勯偅鏍嬪埆澧?span>”
  
鎴戯細鎴戜拱錛屾垜涔幫紝榪樻湁鍚楋紵
   Mary
錛?span>“浣犵殑灝忓紵寮熷繀欏昏鏈?chmetcnv unitname="cm" sourcevalue="50" hasspace="False" negative="False" numbertype="1" tcsc="0" w:st="on">50cm闀?span>”
  
鎴戣剳琚嬪棥鐨勪竴澹幫紝鍧愬湪妞呭瓙涓婏紝涓鍜墮錛?span>“鎴戝壀錛屾垜鍓紝榪樻湁鍚楋紵
   ……

榪唬瀛愭ā寮?/span>錛氳凱浠e瓙妯″紡鍙互欏哄簭璁塊棶涓涓仛闆嗕腑鐨勫厓绱犺屼笉蹇呮毚闇茶仛闆嗙殑鍐呴儴琛ㄨ薄銆傚涓璞¤仛鍦ㄤ竴璧峰艦鎴愮殑鎬諱綋縐頒箣涓鴻仛闆嗭紝鑱氶泦瀵硅薄鏄兘澶熷寘瀹逛竴緇勫璞$殑瀹瑰櫒瀵硅薄銆傝凱浠e瓙妯″紡灝嗚凱浠i昏緫灝佽鍒頒竴涓嫭绔嬬殑瀛愬璞′腑錛屼粠鑰屼笌鑱氶泦鏈韓闅斿紑銆傝凱浠e瓙妯″紡綆鍖栦簡鑱氶泦鐨勭晫闈€傛瘡涓涓仛闆嗗璞¢兘鍙互鏈変竴涓垨涓涓互涓婄殑榪唬瀛愬璞★紝姣忎竴涓凱浠e瓙鐨勮凱浠g姸鎬佸彲浠ユ槸褰兼鐙珛鐨勩傝凱浠g畻娉曞彲浠ョ嫭绔嬩簬鑱氶泦瑙掕壊鍙樺寲銆?

17
銆?span>MEDIATOR 鈥?/span>鍥涗釜MM鎵撻夯灝嗭紝鐩鎬簰涔嬮棿璋佸簲璇ョ粰璋佸灝戦挶綆椾笉娓呮浜嗭紝騫鎬簭褰撴椂鎴戝湪鏃佽竟錛屾寜鐓у悇鑷殑絳圭爜鏁扮畻閽憋紝璧氫簡閽辯殑浠庢垜榪欓噷鎷匡紝璧斾簡閽辯殑涔熶粯緇欐垜錛屼竴鍒囧氨OK鍟︼紝淇哄緱鍒頒簡鍥涗釜MM鐨勭數璇濄?

璋冨仠鑰呮ā寮?/span>錛氳皟鍋滆呮ā寮忓寘瑁呬簡涓緋誨垪瀵硅薄鐩鎬簰浣滅敤鐨勬柟寮忥紝浣垮緱榪欎簺瀵硅薄涓嶅繀鐩鎬簰鏄庢樉浣滅敤銆備粠鑰屼嬌浠栦滑鍙互鏉炬暎鍋跺悎銆傚綋鏌愪簺瀵硅薄涔嬮棿鐨勪綔鐢ㄥ彂鐢熸敼鍙樻椂錛屼笉浼氱珛鍗沖獎鍝嶅叾浠栫殑涓浜涘璞′箣闂寸殑浣滅敤銆備繚璇佽繖浜涗綔鐢ㄥ彲浠ュ郊姝ょ嫭绔嬬殑鍙樺寲銆傝皟鍋滆呮ā寮忓皢澶氬澶氱殑鐩鎬簰浣滅敤杞寲涓轟竴瀵瑰鐨勭浉浜掍綔鐢ㄣ傝皟鍋滆呮ā寮忓皢瀵硅薄鐨勮涓哄拰鍗忎綔鎶借薄鍖栵紝鎶婂璞″湪灝忓昂搴︾殑琛屼負涓婁笌鍏朵粬瀵硅薄鐨勭浉浜掍綔鐢ㄥ垎寮澶勭悊銆?

18
銆?span>MEMENTO
鈥?/span>鍚屾椂璺熷嚑涓?span>MM鑱婂ぉ鏃訛紝涓瀹氳璁版竻妤氬垰鎵嶈窡MM璇翠簡浜涗粈涔堣瘽錛屼笉鐒?span>MM鍙戠幇浜嗕細涓嶉珮鍏寸殑鍝︼紝騫鎬簭鎴戞湁涓蹇樺綍錛屽垰鎵嶄笌鍝釜MM璇翠簡浠涔堣瘽鎴戦兘鎷瘋礉涓浠芥斁鍒板蹇樺綍閲岄潰淇濆瓨錛岃繖鏍峰彲浠ラ殢鏃跺療鐪嬩互鍓嶇殑璁板綍鍟︺?

澶囧繕褰曟ā寮?/span>錛氬蹇樺綍瀵硅薄鏄竴涓敤鏉ュ瓨鍌ㄥ彟澶栦竴涓璞″唴閮ㄧ姸鎬佺殑蹇収鐨勫璞°傚蹇樺綍妯″紡鐨勭敤鎰忔槸鍦ㄤ笉鐮村潖灝佽鐨勬潯浠朵笅錛屽皢涓涓璞$殑鐘舵佹崏浣忥紝騫跺閮ㄥ寲錛屽瓨鍌ㄨ搗鏉ワ紝浠庤屽彲浠ュ湪灝嗘潵鍚堥傜殑鏃跺欐妸榪欎釜瀵硅薄榪樺師鍒板瓨鍌ㄨ搗鏉ョ殑鐘舵併?

19
銆?span>OBSERVER 鈥?/span>鎯崇煡閬撳挶浠叕鍙告渶鏂?span>MM鎯呮姤鍚楋紵鍔犲叆鍏徃鐨?span>MM鎯呮姤閭歡緇勫氨琛屼簡錛?span>tom璐熻矗鎼滈泦鎯呮姤錛屼粬鍙戠幇鐨勬柊鎯呮姤涓嶇敤涓涓竴涓氱煡鎴戜滑錛岀洿鎺ュ彂甯冪粰閭歡緇勶紝鎴戜滑浣滀負璁㈤槄鑰咃紙瑙傚療鑰咃級灝卞彲浠ュ強鏃舵敹鍒版儏鎶ュ暒

瑙傚療鑰呮ā寮?/span>錛氳瀵熻呮ā寮忓畾涔変簡涓縐嶄竴闃熷鐨勪緷璧栧叧緋伙紝璁╁涓瀵熻呭璞″悓鏃剁洃鍚煇涓涓富棰樺璞°傝繖涓富棰樺璞″湪鐘舵佷笂鍙戠敓鍙樺寲鏃訛紝浼氶氱煡鎵鏈夎瀵熻呭璞★紝浣夸粬浠兘澶熻嚜鍔ㄦ洿鏂拌嚜宸便?

20
銆?span>STATE 鈥?/span>璺?span>MM浜ゅ線鏃訛紝涓瀹氳娉ㄦ剰濂圭殑鐘舵佸摝錛屽湪涓嶅悓鐨勭姸鎬佹椂濂圭殑琛屼負浼氭湁涓嶅悓錛屾瘮濡備綘綰﹀ス浠婂ぉ鏅氫笂鍘葷湅鐢靛獎錛屽浣犳病鍏磋叮鐨?span>MM灝變細璇?span>“鏈変簨鎯呭暒錛屽浣犱笉璁ㄥ帉浣嗚繕娌″枩嬈笂鐨?span>MM灝變細璇?span>“濂藉晩錛屼笉榪囧彲浠ュ甫涓婃垜鍚屼簨涔堬紵錛屽凡緇忓枩嬈笂浣犵殑MM灝變細璇?span>“鍑犵偣閽燂紵鐪嬪畬鐢靛獎鍐嶅幓娉″惂鎬庝箞鏍鳳紵錛屽綋鐒朵綘鐪嬬數褰辮繃紼嬩腑琛ㄧ幇鑹ソ鐨勮瘽錛屼篃鍙互鎶?span>MM鐨勭姸鎬佷粠涓嶈鍘屼笉鍠滄鍙樻垚鍠滄鍝︺?

鐘舵佹ā寮?/span>錛氱姸鎬佹ā寮忓厑璁鎬竴涓璞″湪鍏跺唴閮ㄧ姸鎬佹敼鍙樼殑鏃跺欐敼鍙樿涓恒傝繖涓璞$湅涓婂幓璞℃槸鏀瑰彉浜嗗畠鐨勭被涓鏍楓傜姸鎬佹ā寮忔妸鎵鐮旂┒鐨勫璞$殑琛屼負鍖呰鍦ㄤ笉鍚岀殑鐘舵佸璞¢噷錛屾瘡涓涓姸鎬佸璞¢兘灞炰簬涓涓娊璞$姸鎬佺被鐨勪竴涓瓙綾匯傜姸鎬佹ā寮忕殑鎰忓浘鏄涓涓璞″湪鍏跺唴閮ㄧ姸鎬佹敼鍙樼殑鏃跺欙紝鍏惰涓轟篃闅忎箣鏀瑰彉銆傜姸鎬佹ā寮忛渶瑕佸姣忎竴涓郴緇熷彲鑳藉彇寰楃殑鐘舵佸垱绔嬩竴涓姸鎬佺被鐨勫瓙綾匯傚綋緋葷粺鐨勭姸鎬佸彉鍖栨椂錛岀郴緇熶究鏀瑰彉鎵閫夌殑瀛愮被銆?

21
銆?span>STRATEGY 鈥?/span>璺熶笉鍚岀被鍨嬬殑MM綰︿細錛岃鐢ㄤ笉鍚岀殑絳栫暐錛屾湁鐨勮鐢靛獎姣旇緝濂斤紝鏈夌殑鍒欏幓鍚冨皬鍚冩晥鏋滀笉閿欙紝鏈夌殑鍘繪搗杈規氮婕渶鍚堥傦紝鍗曠洰鐨勯兘鏄負浜嗗緱鍒?span>MM鐨勮姵蹇冿紝鎴戠殑榪?span>MM閿﹀泭涓湁濂藉Strategy鍝︺?

絳栫暐妯″紡錛氱瓥鐣ユā寮忛拡瀵逛竴緇勭畻娉曪紝灝嗘瘡涓涓畻娉曞皝瑁呭埌鍏鋒湁鍏卞悓鎺ュ彛鐨勭嫭绔嬬殑綾諱腑錛屼粠鑰屼嬌寰楀畠浠彲浠ョ浉浜掓浛鎹€傜瓥鐣ユā寮忎嬌寰楃畻娉曞彲浠ュ湪涓嶅獎鍝嶅埌瀹㈡埛绔殑鎯呭喌涓嬪彂鐢熷彉鍖栥傜瓥鐣ユā寮忔妸琛屼負鍜岀幆澧冨垎寮銆傜幆澧冪被璐熻矗緇存寔鍜屾煡璇㈣涓虹被錛屽悇縐嶇畻娉曞湪鍏蜂綋鐨勭瓥鐣ョ被涓彁渚涖傜敱浜庣畻娉曞拰鐜鐙珛寮鏉ワ紝綆楁硶鐨勫鍑忥紝淇敼閮戒笉浼氬獎鍝嶅埌鐜鍜屽鎴風銆?

22
銆?span>TEMPLATE METHOD 鈥斺?/span>鐪嬭繃銆婂浣曡鏈嶅コ鐢熶笂搴娿嬭繖閮ㄧ粡鍏告枃绔犲悧錛熷コ鐢熶粠璁よ瘑鍒頒笂搴婄殑涓嶅彉鐨勬楠ゅ垎涓哄閥閬囥佹墦鐮村兊灞銆佸睍寮榪芥眰銆佹帴鍚匯佸墠鎴忋佸姩鎵嬨佺埍鎶氥佽繘鍘誨叓澶ф楠?span>(Template method)錛屼絾姣忎釜姝ラ閽堝涓嶅悓鐨勬儏鍐碉紝閮芥湁涓嶄竴鏍風殑鍋氭硶錛岃繖灝辮鐪嬩綘闅忔満搴斿彉鍟?span>(鍏蜂綋瀹炵幇)錛?

妯℃澘鏂規硶妯″紡錛氭ā鏉挎柟娉曟ā寮忓噯澶囦竴涓娊璞$被錛屽皢閮ㄥ垎閫昏緫浠ュ叿浣撴柟娉曚互鍙婂叿浣撴瀯閫犲瓙鐨勫艦寮忓疄鐜幫紝鐒跺悗澹版槑涓浜涙娊璞℃柟娉曟潵榪嬌瀛愮被瀹炵幇鍓╀綑鐨勯昏緫銆備笉鍚岀殑瀛愮被鍙互浠ヤ笉鍚岀殑鏂瑰紡瀹炵幇榪欎簺鎶借薄鏂規硶錛屼粠鑰屽鍓╀綑鐨勯昏緫鏈変笉鍚岀殑瀹炵幇銆傚厛鍒跺畾涓涓《綰ч昏緫妗嗘灦錛岃屽皢閫昏緫鐨勭粏鑺傜暀緇欏叿浣撶殑瀛愮被鍘誨疄鐜般?

23
銆?span>VISITOR 鈥?/span>鎯呬漢鑺傚埌浜嗭紝瑕佺粰姣忎釜MM閫佷竴鏉熼矞鑺卞拰涓寮犲崱鐗囷紝鍙槸姣忎釜MM閫佺殑鑺遍兘瑕侀拡瀵瑰ス涓漢鐨勭壒鐐癸紝姣忓紶鍗$墖涔熻鏍規嵁涓漢鐨勭壒鐐規潵鎸戯紝鎴戜竴涓漢鍝悶寰楁竻妤氾紝榪樻槸鎵捐姳搴楄佹澘鍜岀ぜ鍝佸簵鑰佹澘鍋氫竴涓?span>Visitor錛岃鑺卞簵鑰佹澘鏍規嵁MM鐨勭壒鐐歸変竴鏉熻姳錛岃紺煎搧搴楄佹澘涔熸牴鎹瘡涓漢鐗圭偣閫変竴寮犲崱錛岃繖鏍峰氨杞繪澗澶氫簡錛?

璁塊棶鑰呮ā寮?/span>錛氳闂呮ā寮忕殑鐩殑鏄皝瑁呬竴浜涙柦鍔犱簬鏌愮鏁版嵁緇撴瀯鍏冪礌涔嬩笂鐨勬搷浣溿備竴鏃﹁繖浜涙搷浣滈渶瑕佷慨鏀圭殑璇濓紝鎺ュ彈榪欎釜鎿嶄綔鐨勬暟鎹粨鏋勫彲浠ヤ繚鎸佷笉鍙樸傝闂呮ā寮忛傜敤浜庢暟鎹粨鏋勭浉瀵規湭瀹氱殑緋葷粺錛屽畠鎶婃暟鎹粨鏋勫拰浣滅敤浜庣粨鏋勪笂鐨勬搷浣滀箣闂寸殑鑰﹀悎瑙h劚寮錛屼嬌寰楁搷浣滈泦鍚堝彲浠ョ浉瀵硅嚜鐢辯殑婕斿寲銆傝闂呮ā寮忎嬌寰楀鍔犳柊鐨勬搷浣滃彉鐨勫緢瀹規槗錛屽氨鏄鍔犱竴涓柊鐨勮闂呯被銆傝闂呮ā寮忓皢鏈夊叧鐨勮涓洪泦涓埌涓涓闂呭璞′腑錛岃屼笉鏄垎鏁e埌涓涓釜鐨勮妭鐐圭被涓傚綋浣跨敤璁塊棶鑰呮ā寮忔椂錛岃灝嗗敖鍙兘澶氱殑瀵硅薄嫻忚閫昏緫鏀懼湪璁塊棶鑰呯被涓紝鑰屼笉鏄斁鍒板畠鐨勫瓙綾諱腑銆傝闂呮ā寮忓彲浠ヨ法榪囧嚑涓被鐨勭瓑綰х粨鏋勮闂睘浜庝笉鍚岀殑絳夌駭緇撴瀯鐨勬垚鍛樼被銆?/span>

chatler 2009-12-05 10:43 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            一区在线播放| 久久这里有精品15一区二区三区| 开心色5月久久精品| 久久精品水蜜桃av综合天堂| 羞羞视频在线观看欧美| 亚洲午夜精品一区二区| 中文av一区特黄| 亚洲免费在线观看| 久久www成人_看片免费不卡| 久久久久国产成人精品亚洲午夜| 久久亚洲私人国产精品va| 欧美第一黄网免费网站| 国产精品久久综合| 伊人久久亚洲影院| 亚洲视频一区在线| 久久久精品国产一区二区三区| 女女同性精品视频| 日韩午夜av在线| 亚洲欧美视频在线| 久久综合导航| 国产精品大片| 亚洲激情视频| 欧美与黑人午夜性猛交久久久| 美日韩精品视频| 一区二区三区日韩欧美| 麻豆精品在线视频| 国产女主播一区| 亚洲美女一区| 久久婷婷成人综合色| av成人免费| 鲁大师影院一区二区三区| 国产精品女主播一区二区三区| 在线精品亚洲| 午夜精品影院在线观看| 欧美高清在线观看| 性做久久久久久久免费看| 欧美日韩午夜视频在线观看| 亚洲第一搞黄网站| 久久黄金**| 亚洲一区二区成人| 欧美日韩国产另类不卡| 在线视频国产日韩| 欧美专区福利在线| 亚洲一区二区在| 欧美乱大交xxxxx| 经典三级久久| 欧美一级在线视频| 亚洲最新视频在线| 欧美极品在线视频| 亚洲国产精品久久久| 欧美中文字幕视频| 亚洲欧美日韩国产精品| 国产精品久久久久999| 日韩一级二级三级| 国产精品地址| 亚洲成人在线免费| 夜夜精品视频| 亚洲国产乱码最新视频| 午夜精品福利一区二区蜜股av| 欧美日韩免费观看一区三区| 亚洲精品国产精品国自产观看| 久久青草福利网站| 欧美在线视频不卡| 国产一区二区三区日韩| 久久久www成人免费无遮挡大片 | 国产夜色精品一区二区av| 亚洲欧美卡通另类91av| 亚洲视频狠狠| 国产精品永久免费| 久久丁香综合五月国产三级网站| 亚洲免费在线视频| 韩国视频理论视频久久| 免费成人高清| 欧美电影在线观看完整版| 亚洲精品视频二区| 日韩视频在线永久播放| 国产精品国产三级国产aⅴ入口 | 亚洲精品国产精品乱码不99按摩| 欧美高清在线观看| 欧美日韩国产综合网 | 中文av一区特黄| 亚洲一二三区在线| 红桃视频欧美| 亚洲精品美女久久久久| 国产精品久久网| 麻豆国产精品777777在线| 免费亚洲一区| 午夜日韩激情| 久久午夜av| 亚洲综合精品一区二区| 欧美在线啊v一区| 亚洲精品女av网站| 亚洲永久免费视频| 亚洲国产美女| 亚洲综合第一页| 亚洲国产精品一区二区www| 日韩亚洲欧美成人| 黄色成人在线网址| 日韩视频不卡| 狠狠久久婷婷| 一区二区三区国产精品| 一区二区视频免费完整版观看| 91久久午夜| 精品69视频一区二区三区| 99视频一区二区三区| 在线看国产日韩| 亚洲影院在线观看| 一区二区三区国产| 久久久久久久性| 欧美一区二区三区喷汁尤物| 欧美一区1区三区3区公司| 亚洲午夜一区二区三区| 最新国产乱人伦偷精品免费网站 | 亚洲精品在线一区二区| 欧美一区综合| 午夜精品久久久久久99热软件| 久久福利视频导航| 亚洲欧美日韩精品久久| 欧美精品一区二区蜜臀亚洲| 久久久综合激的五月天| 国产精品入口福利| av成人免费观看| 一本久道久久综合中文字幕| 久久亚洲私人国产精品va媚药| 欧美一级视频精品观看| 国产精品久久久久久一区二区三区 | 亚洲精品国产精品国自产在线 | 久久综合影视| 国产精品婷婷午夜在线观看| 日韩视频在线观看免费| 99re8这里有精品热视频免费 | 国产精品自拍一区| 在线视频欧美一区| 亚洲一区美女视频在线观看免费| 欧美国产成人在线| 欧美黄色视屏| 亚洲国产精品专区久久| 久久尤物视频| 欧美成人69| 亚洲国内在线| 欧美电影专区| 亚洲黄色尤物视频| 亚洲精品永久免费| 欧美连裤袜在线视频| 99re在线精品| 亚洲欧美日韩另类精品一区二区三区| 欧美午夜不卡在线观看免费 | 亚洲无线视频| 欧美在线观看网站| 国产在线视频欧美| 久久夜色撩人精品| 亚洲国产va精品久久久不卡综合| 亚洲黄色在线观看| 欧美日韩大片一区二区三区| 在线视频免费在线观看一区二区| 亚洲在线第一页| 国产日韩欧美综合| 久久婷婷蜜乳一本欲蜜臀| 91久久综合| 欧美一区国产二区| 亚洲高清视频一区| 欧美日韩在线观看视频| 午夜精品久久久久久久久久久久久| 久久久天天操| 美女999久久久精品视频| 久久夜色精品国产噜噜av| 亚洲成人影音| 国产精品v欧美精品v日韩| 亚洲欧美中文字幕| 亚洲国产岛国毛片在线| 亚洲一区精品在线| 一区在线播放| 国产精品va在线| 久久久久久久一区二区三区| 亚洲精品国产系列| 久久夜色精品国产欧美乱| 99xxxx成人网| 狠狠爱成人网| 国产精品久久久免费| 免费欧美电影| 欧美一级精品大片| 亚洲三级免费| 蜜臀久久久99精品久久久久久| 一区二区三区福利| 尤物在线观看一区| 国产美女精品免费电影| 欧美日本在线播放| 久久亚洲国产精品一区二区| 在线亚洲精品| 亚洲欧洲日产国产综合网| 久久久在线视频| 欧美一区二区| 亚洲网在线观看| 99精品视频免费观看| 亚洲激情电影中文字幕| 黄色工厂这里只有精品| 国产欧美一区二区精品仙草咪| 欧美日韩亚洲一区二区| 欧美激情aⅴ一区二区三区| 久久综合免费视频影院|