Grid applications must increasingly self-adapt dynamically to changing environments. In most cases, adaptation has been implemented in an ad hoc fashion, on a per-application basis. This paper describes work which generalizes adaptation so that it can be used across applications by providing an adaptation framework. This framework uses a software architectural model of the system to analyze whether the application requires adaptation, and allows repairs to be written in the context of the architectural model and propagated to the running system. In this paper, we exemplify our framework by applying it to the domain of load-balancing a client-server system. We report on an experiment conducted using our framework, which illustrates that this approach maintains architectural requirements. 1. Motivation and Approach Grid computing infrastructures [10,14] offer a wide range of distributed resources to applications. However, the het-erogeneity of both the network and computing resources, and the dynamic load conditions make, adaptation an important requirement for grid applications. For example, the applications must be able to adapt themselves at runtime to handle such things as resource variability (network bandwidth, server availability, etc.) and system faults (servers and networks going down, failure of external components, etc.). If the system is not adaptive, it will often have unacceptably poor performance. In the past, managing and changing systems required human oversight , but in order to be practical, grid applications must be able to adapt automatically, with minimal human intervention. Adaptability in most applications so far has been implemented in a fairly ad hoc fashion. The code that deals with adaptation is typically embedded in the application code. While this may work for local adaptation (i.e., for a single node or communication channel), it does not work well for global adaptation (e.g., that requires changes in the structure of the application) or in cases where multiple adaptation operations have to be coordinated. It also complicates both the application and adaptation code and makes the reuse of adaptation strategies impossible. In this paper we present an alternative approach in which system models-in particular, software architectural models-are maintained at runtime and used as a basis for system reconfiguration and adaptation. An architectural model of a system is one in which the overall structure of a running system is captured as a composition of coarse-grained interacting components and connectors [20,22]. As a basis for self-repair, the use of architectural models has a number of nice properties: (1) An architectural model can provide a global perspective on the system allowing one to determine non-local changes to achieve some property; (2) architectural models can make "integ-rity" constraints explicit, helping to ensure the validity of any change; and (3) by "externalizing" the monitoring and adaptation of a system using architectural models, it is possible to engineer adaptatio...