International audienceAdvanced programming techniques such as metaprogramming and computational reflection, as well as the more recent paradigm of aspect-oriented programming (AOP), serve important objectives of software engineering such as modularization and adaptability. In this tool presentation paper, we briefly overview this area and present Reflex, a portable tool for flexible metaprogramming and AOP in Java. Reflex provides both structural and behavioral facilities adopting a uniform model of partial reflection. This allows selective and fine-grained control of where and when reflection occurs. The facilities of Reflex make it easy to experiment with (combinations of) advanced uses of AOP and reflection without reinventing the wheel ...