Abstract. In component-based software development, the mechanism by which the software components which best satisfy a user's query are retrieved is indispensable. However, conventional retrieval methods cannot evaluate the total characteristics of a component, because they consider a single aspect of the component or require an additional description. In this paper, we propose a new distance metric, "directed replaceability distance" (DRD), which represents how different two components are in detail from the viewpoint of structure, behavior, and granularity. We have developed a retrieval system which uses DRD as a measure of the difference between a user's query prototype component and the components stored in a repository. In this paper, we outline the concept of DRD and the usefulness of our retrieval system.