Title: The practical application of design patterns
Author: Walter Hurst
Usually, concepts and these concepts are different in the real world, and the design model is no exception. The design pattern is everywhere. When reading a publication or browsing website in reading technology, it is easy to find references to design patterns. So far, you are likely to read (at least over) some design patterns, such as "Core J2EE DESIGN PATTERNS" or "Design Patterns" written in Gang '. At this point, you may have some questions about the design mode. How can design patterns help me? Are they a silver? Is there any problem with the design pattern? Why can't I get design modes from Integrated Development Environment (IDE)? Several problems described above are some classic issues encountered during processing. Usually, concepts and these concepts are different from the application in the world, and the design model is no exception. This article will discuss the application of design patterns in the real world. This information can help you successfully use design patterns in your project to make the correct decision. Quick Overview Design Mode provides a way of sharing experience that allows groups to benefit and avoid continuous retrieving inventions. Design mode usually captures the description of the problem, the context of the problem, the recommended problem solution, and the result that can be foreseen after using the solution. In order to have the most widely applicability (for more readers), design patterns are usually abstracts depending on the exact details of the environment. This abstraction produces some decodes necessary to apply design patterns to existing cases. This is an important detail: despite the design model is a good way to share professional knowledge, it usually is very important for correct application expertise. Design Mode This concept is initially generated in the construction industry. Designers (design buildings rather than computer systems) aware of them need to share ideas related to correct design technology. These ideas are formed in design patterns that the designer group will benefit from sharing experience and lessons. The design model enters the computer system field from the construction industry in the late 1980s. Object-Oriented, OO principle has gradually spread, and design model has become the best practice of cultivating new OO followers. Richard Gamma et al. (People usually call "Design Patterns: Elements of Reusable Object-Oriented Software" in Gang of Four [GOF] makes design patterns a focus of attention. As the design pattern is gradually popular, the fields they involve are gradually wide as the "Ben and Jerry" effect. For those who are not familiar with famous ice cream brands, Ben and Jerry is a supplier of ice cream products, and their ice cream products have a variety of ingredients that can be imagined (including some of you will always imagine). Therefore, it is the design pattern, and the ordinary OO design mode is the work of GOF, but it is now included in the design mode provided for development language, application servers, industry synthesis, etc. Design mode classification design patterns are usually combined according to some public characteristics. The work of GOF is divided into three categories: Creational, Behaviooral and Structural. Design patterns for J2EE are usually divided into a presetentation tier, a business logic tier, and an Integration Tier. This grouping method can make the public detail that describes all design patterns more easily, or makes the classification of design patterns and discovery easier. In the discussion of the practical application of design patterns, you need to divide the design pattern into two categories: Broad Exposure and Isolated Use.
This division is based on design patterns to the visibility of application designers and developers and multiple parts of the application on design patterns. The Broad Exposition design mode is known for the design and development of multiple team members or applications. The quality of this type of design pattern includes: adopting it will have a negative impact on many classes created according to design patterns. Different parts of the application know the use of design patterns. Decision using this design pattern cannot be easily canceled. Examples of this type of design pattern include Model-View-Controller (MVC) mode, Value Object J2EE mode, and Data Access Object (DAO) J2EE Mode ISOLATED USE means the design mode of design mode is the design mode of hidden detail. This type of design pattern includes:
The design pattern does not affect other team members or other parts of the application. It can easily change the decision to use design mode, and the resulting impact is extremely small. Examples of this type of design pattern have Singleton GOF mode or Intercepting Filter J2EE mode. The design pattern is divided into several categories to provide a quick way for the scope of the design mode. Understanding the scope makes the impact of assessment design patterns easier. Can I use or abandon this design pattern? Once this design mode affects the design of the application? This design pattern affects multiple parts of the application and other applications? In advance, these effects provide guidance for adopting design patterns. Design Mode Application AntipatterNS As the design pattern is gradually popular, another mode type called Antipatterns appears. Although design patterns provide expertise on repeatable best methods, Antipatterns usually describes repetitive behavior that should be avoided. Antipatterns verifies the fact that there is a mistake and the people who are working. This section will explore the antipatterns in the design pattern. Understanding these antipatterns can help you avoid the defects in design patterns. Like design patterns, when they provide some vision or they are some very familiar environments, they can add color to your experience and make you no longer feel lonely, here's ATIPATTERNS is a new concept. If you want to read more information about Antipatterns, see the list of resources at the end of this article. Antipattern list design mode? Yes, we all have problems: which design mode is determined in the project. Application: There is both Broad Exposition and Isolated Use Design Mode. Environment: A developer uses the design mode in an engineering. Power: Antipattern's motivation usually has two sources. One is the desire to improve the project by the best practice of the design model. The other is that developers are naturally curious to drive him with this project to study design models. Recommended solution: All well-known design patterns are applied in the project. The design mode manual generates a list, and the goal is to check all the design patterns. The context of the context: project team and delivery application suffer losses due to unnatural introduction of too many design modes. This leads to design and development very complicated. This unnecessary complexity will affect the development results from the workload that has been completed, the development team understands the ability of things, the actual performance and the correctness of the application. Design Basic Principle: Design mode is the main source of expertise. Although it is very good, all them are not necessarily good. Actual solution: Description of design patterns contains the target context of the usage mode. You must consider how to ensure the design pattern matching items. Second, the design pattern is not from the work of someone who reads a design pattern, "I can use this design pattern where?" Is from someone to find a problem with the problem. Developer / Project Antipattern (also known as: Design Pattern XYZ? Yeah, 10 we have 10) Problems: Control design mode between projects or projects. Application: Broad Exposure and ISOLATED USE design patterns benefit from resolution. However, the Broad Exposition design pattern undoubtedly controls the implementation. Context: The development team combines design patterns into the project. The team consists of many experienced developers, they know when to use design patterns. So it will design the correct design mode. If you involve multiple projects, there is no design mode to achieve sharing between items. Power: The final period is increasing, and the team member work is high. Re-use implementation affects team efficiency. Suppose they are experts, their implementation is excellent.
In multi-project cases, cross-team communications and code sharing either not considered, or be excluded as the potential impact as a schedule. Recommended solution: Teams can include and implement design patterns individually as needed. The context produced: even if the correct design pattern is used, they are implemented in many different ways. There is incompatible between the implementation of restriction integration and re-use. Many unnecessary time and work are spent in maintenance, debugging, and expanding a variety of implementations. In the end, various implementations will be unified. Design Basic Principles: Expert members should be allowed to work independently. As long as the design pattern contained is good enough, you will not need to share. Actual Solution: The development team should coordinate the design mode. A common implementation of shared design patterns can reduce costs in the future, but more importantly, it makes it more compatible with developers. Such sharing can be restricted to the Broad Exposure Design mode previously discussed previously if needed. Rehabilitation is also very valuable between projects, especially when it will be integrated in the future. The design pattern uses the character IDE of the IDE to continue to develop and provide more features. The initial IDE constitutes an editing environment and some debugging tools. Now they usually include design environment, auditing tools, configuration management system integration, and more. As the IDE continues to expand, you need to confirm that they are in the role in design mode implementation. It is true that the design model is implemented in the development language, and IDE can be used to edit source code. However, can IDE play other roles? Some IDEs have a drop-down menu that enables you to select the design pattern included in the application. Although this can speed up the use of design patterns, it will only result in a very bad code. Assess this feature needs to remember several factors. First, the design pattern describes the problem in abstraction and requires some decoding to achieve the correct implementation. However, they often include "Sample Implementation" and IDE is inserting this example class structure into the application. This is likely not the implementation you need and put them in the application will bring more confusion, and need more editing and reconstruction work rather than thinking about the initial implementation. Second, another problem associated with the IDE drag and drop design mode is the two Antipalns discussed earlier. Accelerating the implementation of the design pattern is likely to produce a large number of design patterns, and a variety of versions of the same design pattern, rather than resolving any questions. The challenge facing design model is not only a quick implementation, but it is determined that the correct implementation is used, as well as a perfect implementation in the organization. BEA WebLogic Workshop 8.1 and Design Mode You may be a BEA customer, if you are reading this article, you may want to know how new BEA WebLogic Workshop 8.1 affects your design mode consideration. First, WebLogic Workshop is IDE, so the previous chapter of the IDE is also applicable. Two additional aspects of Workshop interested in these discussions are controls and pre-real design patterns. WebLogic Workshop Controls is a way to package features that can easily include them in applications that use Workshop IDE. The package includes the desired visual elements, runtime behavior, and the requirements, etc. How does the control affect the design mode application? Remember the design pattern to be divided into ISOLATED USE and BROAD Exposure? Design patterns that are divided into the ISOLATED USE class may be packaged into Workshop Controls. Packaging the design pattern as a control can make the other user of Workshop IDE to achieve implementation in every developer / project Antipattern. You may want to know why Broad Exposition Design Mode cannot be implemented as a control. The reason is that the Broad Exposition design pattern causes many other classes or independent applications.
This situation is not suitable for the plug and play of the control. The use of Broad Exposition design patterns should be three thoughts, and once it is used, it cannot be easily canceled. These requirements do not comply with the goals of WebLogic Workshop Control. WebLogic Workshop also has a lot of pre-implement design patterns such as PageFlow and user interface structures. In Workshop, you can create JSP and definition PageFlow to control the positioning between the web application page. In this case, WebLogic Workshop uses a popular Apache Struts performance layer framework. This aspect of Workshop (using Struts) provides a Model-View-Controller (MVC) design mode implementation means that you don't have to create your own MVC implementation. Other features included in Workshop are likely to replace your own design pattern implementation. Although some design patterns are implemented very well, it should be verified that it is also very suitable for WebLogic, which is not only implemented but also created. Three steps to successfully use design patterns How to combine design patterns and increasingly adjacent deadlines, austerity budget and many company's existing limited team resources? The following is three steps to successfully develop design patterns. Powerful communications and training Many organizations have leading technology, may officially pass the demonstration or informal recognition experts of the designer forum. These leaders will promote open communications in design patterns and will train develop specific design patterns. Communication should cross the development team and project to prevent the use of shaft and a variety of unique implementations (keep in mind the implementation of each developer / Project Antipattern). Training can use official INTERNAL LUNCH-AND-Learns, formal INTERNAL CLASS or some employees to participate in external training. These training methods will facilitate the correct design mode application. If only a very little viewer can participate in training, the best candidate is those who feel suitable for training their colleagues after they come back. The design pattern adopts guidance design mode to benefit the project, but they may also damage the application because of misuse. They should be encouraged, but the adoption of it should be reviewed and verified. The design pattern can be included in the design and development process. In either case, the use of design patterns should be confirmed and verified by the reviewer. This may also be encountered during the review process, and additional design patterns are not applicable to the place originally included. This step can also be done through colleagues' review or team discussion even if there is no formal review in the environment. The reviewers in this step are either a member of the main team or establish an open communication with them. Guidelines are critical to design patterns for Broad Exposition categories. These design patterns have a lot of related risks because they will create dependencies. These dependencies may be in some object classes, for example, work only in a more wide DAO design mode implementation range, or cross-use program boundaries (such as using the Value Object design mode in applications and applications) Transfer data between layers). These design patterns can also be implemented by other people or different projects in the project, and implementation should be reused, different from the creation of another unique implementation. Reuse implementation, not just design mode, as long as you have certain satisfaction in the implementation of your design mode, the team and company can get more benefits when reused at the code layer, not design creative layers. The initial design pattern benefited by enterprises is an improved implementation. However, the real goal is to reuse. Reuse implementation will result in: a) Other reusable classes (depending on public implementation); b) shorten development time and reduce cost; C) shortened maintenance time and reduce costs; d) D) between applications and easily integrate between applications. This reuse is very important to the Broad Exposition design mode (sometimes basic).
These design patterns have created external dependencies (integration will benefit from public implementations) or produce all custom class libraries (if there is a public foundation will be reused). Isolated USE design mode can also benefit from reuse, but if they are customized according to specific circumstances, they are very difficult to reuse. Sometimes you may ask yourself: "If you reuse more, why can you apply it together?" In our discussion of design mode how to make more readers will discuss this problem. If possible, if you have already predefined, it will be very difficult to achieve a wide range of applicability. However, once the design pattern is applied to a special problem or technology infrastructure, it can be reused in this environment. Design patterns in the architecture This looks like a terrible task, you need to master how the design model is applied in the actual situation, how to build a quality implementation, and how to promote reuse. One way to complete this task is to introduce an application architecture in an environment. The application architecture provides the structure you need, so that the development team can pay attention to the domain logic of the application. This contains the implemented design model. In addition to reusing design mode concepts or individual implementations, you can reuse architectures between multiple items and applications. This shared public implementation ensures compatibility and provides a low cost alternative for development and maintenance of many different implementations. Compatibility provides the technical foundation for reuse needs. There is not enough space here to discuss other important quality of the architecture, such as runtime monitoring and management, configuring applications logic and adaptive behavior. You can learn more about architectures from Carnegie Mellon Software Engineering Institute (www.sei.cmu.edu/ata/ata_init.html). Conclusion Design mode is an amazing resource that should be used to increase your advantage. Although design patterns provide reusable concepts, the challenge is to decide which design mode and is committed to reuse. By understanding the risk in design mode, you can avoid risk when you continue to learn and implement more design modes. The steps outlined in this paper will generate a process for use in a successful design pattern in team and institutions. Reference BROWN, WILLIAM J.; Malveau, Raphael C.; McCormick, Hays W. "Skip"; Mowbray, Thomas J. (1998). "AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis", John Wiley & Sons AntiPatterns: www.antipatterns.com Wiki site: http: //c2.com/cgi/wiki AntiPattern founder About the Author Walter Hurst is Wakesoft of? And Chief Technology. He worked in the cutting-edge technology field for ten years. Before Wakesoft was established, Walter is an independent consultant, mainly using the early versions of WakeSoft technology to provide Internet solutions. Prior to this, Walter is the Technical designer of Xpedior, responsible for leading the application architecture that INTERNAL EFForts developed in multiple customer projects. Before joining Xpedior, Walter is a senior consultant in Andersen Consulting? Center strategy technology. In Andersen, Walter leads the Enterprise project for many wealth 100 customers. Walter won a bachelor's degree in computer engineering in Michigan University. Original source http://www.sys-con.com/story/storyid=42952&de=1