Abstract:During the whole lifecycle of component reuse, it is necessary for designers to continuously re-design and refactor components to improve usability, e.g., reuse cost, reuse efficiency, etc, under the guarantee of high usefulness. For this purpose, this paper presents a reuse cost optimization oriented, locality principle and instance set decomposition based component refactoring method. A feature-oriented component model is firstly introduced, with emphasis on component reuse mechanism based on variation point. By analysis of the constituents of reuse cost, the optimization goal, i.e., increasing the proportion of fixed part of a component, is put forward. Then, the temporal and spatial locality in component reuse process is analyzed elaborately, and according to the reuse frequency of each component instance, those instances with higher reuse frequency are separated out to form (semi-)instantiated independent components, so as to decrease the instantiation cost and implementation cost during reuse process. A greedy strategy based component instance set decomposition algorithm is proposed and validated by a practical case. This method may bring some instantiation tasks forward to component design phase instead of in practical reuse phase and transform some variable features into fixed ones by decomposing the dependencies between components into dependencies between component instances, therefore avoiding multiple instantiations during frequent reuse to decrease reuse cost.