Abstract:On-Demand remote executing is an important way to enable an application occupy resource on-demand to guarantee performance as well as improve resource utilization. This paper proposes an automatic program transformation approach for the on-demand remote execution of the computations in a Java application. The core of the approach is a design pattern supporting on-demand remote execution of computations. The research presents the technical challenges of and solutions for transformation, and gives out the DPartner transformation system. Comparing with previous work, DPartner has two major characteristics: first, transformation is carried out automatically; second, the transformed application is able to execute remotely on-demand, so its performance can be improved and the resource utilization can be increased. Additionally, DPartner is designed to be a practicable tool, as it can transform legacy applications with only Java bytecode.