1 Introduction to the content
The Design Patterns Toolkit (Toolkit) is an eclipse-based template engine that provides users with a model-driven framework to help users simplify application development. The user customizes the necessary information for the application through a template, and the design pattern Toolbox helps users automatically build all the artifacts of the application. Using the design pattern Toolbox will significantly accelerate the development of common applications, while the design pattern Toolbox provides users with the best practices for building a class of applications, so using it will help users share the value of best practices.
This article first introduces the basic concepts of design patterns, then introduces the framework of the Design Patterns Toolbox (designing pattern Toolkit), and then, in two examples, describes how to use the design patterns already in the design mode toolbox and how to write new design patterns.
2 design mode
Design patterns describe a common type of problem in software development and the core solution to such problems. With this scenario, users will develop applications that solve such problems more quickly and efficiently. Design patterns typically consist of the following elements:
Schema name: Only a different design pattern is named, so that the designer can use that name in future communication to succinctly describe a class of problems and their solutions.
Problem Description: The description of the problem indicates when it is appropriate to apply the design pattern, and the description of the problem includes not only the problem itself but also the contextual information, and even some constraint information, which is considered valid only when these constraints are met.
Solution: It describes the various elements that must be involved in solving a class of problems, and the associations and collaborations between different elements. The solution is not a concrete example, but a template that can be exploited multiple times on different occasions.
Specifically, experts who develop certain types of applications (such as Portlets, Web Service, or UML profile) encode the implementation steps of an application (Encoding), and the implementation steps may include obtaining application requirements and building all the artifacts of the application. The result of encoding is called pattern, and other developers can easily build similar applications simply by using this pattern (in fact, it is the expert's intellectual property).
Figure 1 Developing an application using design patterns
Figure 1 shows how to develop an application using design patterns, where the developer of the application provides a description of the application's critical information through an XML file and chooses the appropriate pattern, and the engine automatically generates all the artifacts of the application based on the user-supplied program description and the pattern applied.