Abstract. Aspect-Oriented Modeling (AOM) is a promising technique for untangling the concerns of complex enterprise software systems. AOM decomposes the cross-cutting concerns of a model into separate models that can be woven together to form a composite solution model. In many domains, such as multi-tiered e-commerce web applications, separating concerns is much easier than deducing the proper way to weave the concerns back together into a solution model. For example, modeling the types and sizes of caches that can be leveraged by a web application is much easier than deducing the optimal way to weave the caches back into the solution architecture to achieve high system throughput.This paper presents a technique called constraint-based weaving that maps model weaving to a constraint satisfaction problem (CSP) and uses a constraintsolver to deduce the appropriate weaving strategy. By mapping model weaving to a CSP and leveraging a constraint solver, our technique (1) generates solutions that are correct with respect to the weaving constraints, (2) can incorporate complex global weaving constraints, (3) can provide weaving solutions that are optimal with respect to a weaving cost function, and (4) can eliminate manual effort that would normally be required to specify pointcuts and maintain them as target models change. The paper also presents the results of a case study that applies our CSP weaving technique to a representative enterprise Java application. Our evaluation of this case study showed a reduction in manual effort that our technique provides.