| The key thought of patterns is to summarize and accumulate forefathers' successful design experience in the course of software development, and through studying the experience people need not start anew in the face of a new software design question, but reuse the existing patterns to improve production efficiency. So, patterns themselves reflect the thought of reuse. However, because of what a pattern describes being the solutions of a group of similar design problems, its concrete applying environment is various; And at the same time, the user activities during the pattern-applying process will influence the follow-up pattern-applying process and ultimately influence the pattern-applying result. So, at present, pattern reuse is still mostly carried out manually, and the validity of pattern reuse to a great extent depends on the knowledge and experience of pattern users. On the other hand, though object-oriented frameworks can support architecture reuse on certain level, there are still some problems in using a framework, such as fragmented design solutions, specializing complex frameworks, maintaining and tracing implemented design solutions, etc.An approach to pattern reuse, which is based on a pattern model and droved by tasks corresponding to user activities duringpattern-applying process, is described in this paper. Patterns are represented in a simple and accurate form, called pattern specifications. A pattern engine realizing task-driven process takes a specification as input, and generates tasks dynamically as output for pattern users. The generated programming tasks will guide users to gradually instantiate the pattern, and in that way to reuse and maintain the pattern. As an implementation of this approach, This paper also introduces an integratable, expandable pattern tool platform JavaFrames, and its integrated development environmental JavaFrames Eclipse Integration.On the basis of above-mentioned research, according to the differences of instantiation phases and of refinement layers of pattern specifications, starting from two different ways that patterns are reused, we propose two typical pattern reuse tactics in terms of the approach: generic pattern reuse and framework-specific pattern reuse. Generic patterns are used to solving the common design problem that has general meaning, while Framework-specific patterns are patterns extracted from a framework and describe recurring actions and program structures in framework specialization. Reuse tactic of generic patterns can make the reuse of patterns more normalize, more convenient, more prompt, and more operable, and in this way, could help to solve the problem of adapting the versatility of pattern resolution to the diversity of specific application context. On the other hand, because patterns and pattern language can provide very good support for designing, describing, using and specializing a framework, Reuse tactic of framework-specific patterns can solve efficiently the problems appearing when using an object-oriented framework.Within the scope of this two pattern reuse tactics, we studydeeply the development and reuse process of generic patterns and with an example elaborate how the task-driven approach supports the reuse of generic patterns in practice. For framework-specific pattern, we discuss mainly about pattern discovery and how patterns play role in framework specialization. First, we present a goal-oriented approach that can be used to specialize a framework, i.e., to find framework-specific patterns; Then, the goal-oriented approach is applied to a practical framework, and its framework-specific patterns comes into being; finally, an example application is given to commentate how to reuse the found framework-specific patterns during the process of framework specialization. |