We define a method to modularize crosscutting concerns in Component-Based Systems (CBSs) expressed using the Behavior Interaction Priority (BIP) framework. Our method is inspired from the Aspect Oriented Programming (AOP) paradigm which was initially conceived to support the separation of concerns during the development of monolithic systems. BIP has a formal operational semantics and makes a clear separation between architecture and behavior to allow for compositional and incremental design and analysis of systems. We distinguish local from global aspects. Local aspects model concerns at the component level and are used to refine the behavior of components. Global aspects model concerns at the architecture level, and hence refine communications (synchronization and data transfer) between components. We formalize local and global aspects as well as their composition and integration into a BIP system through rigorous transformation primitives. We present AOP-BIP, a tool for Aspect-Oriented Programming of BIP systems, demonstrate its use to modularize logging, security, and fault tolerance in a network protocol, and discuss its possible use in runtime verification of CBSs. represent different concerns. A concern is defined in [15] as a "domain used as a decomposition criterion for a system or another domain with that concern". Domains include logging, persistence, and system policies such as security. Concerns are often found in different parts of a system, or in some cases multiple concerns overlap one region. These are called crosscutting concerns. Aspect-Oriented Programming (AOP) [34,52] aims at modularizing crosscutting concerns by identifying a clear role for each of them in the system, implementing each concern in a separate module, and loosely coupling each module to only a limited number of other modules. Essentially, AOP defines mechanisms to determine the locations of the concerns in the system execution by introducing joinpoints and pointcuts. Then, it determines what to do at these locations by introducing advices. Finally, it provides a mechanism to coordinate all the advices happening at a location by introducing a process called weaving.Motivations and challenges. In Component Based Systems (CBSs), crosscutting concerns arise at the levels of components [19,37] (building blocks) and architectures (communications). Integrating crosscutting concerns in CBSs allows users to reason about crosscutting concerns in separation, and favors correct-by-construction design. Defining an AOP paradigm for CBSs poses multiple challenges. While the execution of a sequential program can be seen as a sequence of instructions, the semantics of a CBS is generally more complex and relies on a notion of architecture imposing several constraints on their execution. As a consequence of these constraints, AOP matching, instrumentation and modifications need to be extended to account for the architecture (i.e., data transfer and rendez-vous between components). Multiple approaches [44,11,19,37,16] have sought to apply AOP for...