This paper presents a component-based model with a novel ranking method (CMR) for constrained evolutionary optimization. In general, many constraint-handling techniques inevitably solve two important problems: (1) how to generate the feasible solutions, (2) how to direct the search to find the optimal feasible solution. For the first problem, this paper introduces a component-based model. The model is useful for exploiting valuable information from infeasible solutions and for transforming infeasible solutions into feasible ones. Furthermore, a new ranking strategy is designed for the second problem. The new algorithm is tested on several well-known benchmark functions, and the empirical results suggest that it continuously found the optimums in 30 runs and has better standard deviations for robustness and stability.