Many software systems need to provide services continuously and uninterruptedly. Meanwhile, these software systems need to keep evolving continuously to fix bugs, add functions, improve algorithms, adapt to new running environments and platforms, or prevent potential problems. This situation makes online evolution an important issue in the field of software maintenance and evolution. This paper proposes a component-based approach to online software evolution. Nowadays component technology has been widely adopted. Component technology facilitates software evolution, but also introduces some new issues. In our approach, an application server is used to evolve the application, without special support from the compiler or operating system. The implementation and performance analysis of our approach are also covered.