The design of distributed systems can be based on exercising either centralized or decentralized control mechanisms as per the application requirements. In this paper, for a centralized controlled distributed system, we design a dynamic object allocation and replication algorithm that adapts to the arriving requests patterns. We propose a mathematical cost model that considers the costs involved in servicing a request, such as I/O cost and communication cost, and design a dynamic algorithm, referred to as dynamic window mechanism (DWM). Our objective is to minimize the total servicing cost of all the arriving requests. We use competitive analysis to quantify the performance of DWM algorithm in the stationary computing environment (SCE) and extend our analytical study to the mobile computing environment (MCE).