Software design patterns are derived from the architecture model and object movement of Christopher Alexander. According to the view of Alexander, the mode is a repetition of a general solution itself for a particular system. Object movements are focused on the relationship between the real world is modeled as the internal relationship. Based on these two reasons, software design model should be repeated for objects of real-world objects. This article presents the non-software mode instance in the world, these models come from "Design Mode - Decisive Object Software" (DESIGN PATTERNS - Elements of Reusable Object-Oriented Software) [13] . This article also discusses the practice of mode language on non-software expressiveness and design patterns. In the software industry, the group supporter's group is expanding. The origin of model development can be found in the work of architect Christopher Alexander. He believes that the model is a general solution in the world's specific system. The model he describes can be observed in daily buildings. Each mode in "a pattern language" contains a picture of the original example of this mode. Although substances are the mainstream world's view, the model is believed in the software world, and the model also has the root cause of the development of things. Unfortunately, the example of software design patterns is not as rich as Alexander mode, because software design is exquisite ideas rather than those who originally generated. The proppiaibility of most software today limits our opportunity to exposure to first-class design. According to Alexander, the model in the real world is always repeating yourself, because in a specific environment, they always adapt to existing environmental factors. In software, either the real world problem is completely modeled, or the real world object is converted into hardware and software to produce the results of the real world. Since the software design pattern is rooted in Alexander's style and object, it is normal to find software design patterns in the real world. This is not to say that the software design model is an inevitable model of real world things, but it is said that the relationship between the interaction between the actual object can be observed in the "real world" and software object. In order to verify this assumption, we will find an example of a real world for each design pattern.
Create mode
Author (referring to the authors of "design model" - summarizing five creation modes. Examples of creation modes can be found in manufacturing, fast food, biological and administrative agencies. Abstract Factory Example Abstract Factory is to provide an interface that creates a series of associated or interdependent objects without having to specify their specific classes. This model can be found in the metal stamping equipment used in Japan's automobile manufacturing plants. This stamping device can make the car body part. The same machinery is used in the right door of different models, left door, right front fender, left front fender and hood, etc. By using a runner to change the punch plate, the specific class of this machine can be changed within three minutes.
Figure 1: The Burden Example Generator (Builder) Example Generator Mode is separated by the build of complex objects with the performance of the object, thus makes the same build process can create different performance. This model is used for fast food store making children's meals. Typical children's meals include a staple food, a complementary food, a drink and a toy (such as hamburger, fried chicken, cola and toy car). These can be different in different child meals, but the process of combining children's meals is the same. Regardless of the customer point, it is the same as the three cure or chicken, the process is the same. The staff of the counter directly puts staple food, complementary food and toys. These are placed in a bag. The beverage is poured into the cup and placed outside the bag. These processes are the same in mutual competitive restaurants.
Figure 2: Objective Method Method for Using Children's Meals as an example of an example Defines an interface for creating an object, but allows the subclass to decide which class. Pressure is presented in this mode. Plastic toy manufacturer processes plastic powder to inject plastics into the mold that wants shape. The category of the toy (car, characters, etc.) is determined by the mold. Figure 3: Object map of factory methods using implantation formation
Prototype Example Prototype Model Using Prototype Instance Specifies the type of creating objects. The prototype of the new product is usually established before all products. Such prototypes are passive and do not participate in copy itself. A cells have a mitosis, producing two same cells, an example of playing an active role to copy its own prototype, which demonstrates the prototype mode. A cell division produces two cells of the same genotype. In other words, the cells were cloned.
Figure 4: Prototype mode object map using cell split example
Singleton Example Single mode Make sure that a class has only one instance and provides a global access point access to it. Single mode is mimic monitors named, and the definition of a single set is that each collection contains only one element. The president of the US president is a single piece, the US constitution provides for the presidential election, term, and succession of the sequence. In this way, only a current president can be used at any time. Regardless of the current president, its title "President of the United States of America" is a global access point for people who visit this position.
Figure 5: Single piece mode object map using the presidential example
Structural mode
The author summarizes seven structural modes. These modes can be found in tools, residential wirings, mathematics, holiday traditions, retail catalogs, and banking. Adapter Example Adapter Mode allows you to convert a class interface into another interface that is expected, so that you can work together due to interfaces that are not compatible and cannot work together. The wrench provides an example of an adapter. A hole is in ratchet, and the dimensions of each side of the ratchet is the same. In the US typical side length of 1/2 '' and 1/4 ''. Obviously, if a adapter is not used, the ratchet 1/2 '' ratchet is not suitable for 1/4 '' holes. A 1/2 '' to 1/4 '' adapter has a 1/2 '' shaped slot to set a 1/2 '' teeth, and there is a 1/4 cylinder to cartridge 1 / 4 '' wrench.
Figure 6: Adapter object map using a wrench adapter example
Bridge (Bridge) Example Bridge mode separates the abstraction portion with its implementation, so that they can change independently. An ordinary switch-controlled electric light, electric fan, etc. are examples of bridging. The purpose of the switch is to turn the device on or off. The actual switch can be a simple double-knife zipper switch, or a dimming switch.
Figure 7: Adjusts the object into a tree structure to represent a "portion-overall" hierarchy in combination mode using an electronic switch example. Let the user consistently use a single object and a combination object. Although the example is abstract, the arithmetic expression is indeed a combination. The arithmetic expression includes operands, operators, and another operand. The number of operands can be numbers or another expression. In this way, 2 3 and (2 3) (4 * 6) are legal expressions.
Figure 8: Combination mode object map using an arithmetic expression example
Decorator example Decoration mode dynamically adds additional responsibilities to an object. Whether there is a picture without a picture, it can be hung on the wall, but it usually has a picture, and it is actually a picture frame being hung on the wall. Before hanging on the wall, the painting can be blinded, put it into the box; this time the painting, the glass and picture frame form an object. Figure 9: Decorative mode object map with painting frame as an example
Appearance (FACADE) Examples Exterior mode define a unified higher level interface for interfaces in the subsystem for use. When the consumer is procured according to the directory, it reflects an appearance mode. Consumers have dial a number and customer service representative, and the customer service representative played this "look". He contains the interface with the order department, the cash register and the delivery department.
Figure 10: Appearance mode object map using the phone order example
Flyweight Example Enjoyment Mode Use Sharing Technology to effectively support a lot of fine-grained objects. The public switched telephone network (PSTN) is an example of enjoying the yuan. There are some resources such as dialing generators, ringing generators, and dial receivers that must be shared by all users. When a user picks up the handset, he doesn't need to know how much resources have been used. For users, all things are dial tones, call the number, and call the phone.
Figure 11: Enjoyment element mode object map using dial tone generator example
Proxy mode
Agent mode provides an intermediary to control access to this object. A check or bank deposit is a proxy for funds in the account. The check is used in market transactions in place of cash and provides control over the funds on the issuer.
Figure 12: Agent mode object map using the bank deposit case example