Aspect Oriented Programming: add magic to your code and remove Boilerplate
summary
Shows concrete use of AspectJ-style compile-time bytecode weaving to inject logging, transactions and try/catch without proxies, with examples that actually reduce boilerplate. Demonstrates around advice for timing and performance monitoring, annotation-driven caching (memoization), database transaction wrapping, validation by reading annotation parameters, UI-thread posting via handler, automatic field-change hooks to trigger UI updates, role-gated method execution, compile-time package-call checks, and cautions to prefer precise pointcuts and not overuse aspects.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 0:16Who am I
- 0:46What is aspectoriented programming
- 2:08Example code
- 4:44Rules
- 5:32AspectChain
- 6:10Interface
- 8:22Running Performance Monitoring
- 9:17Memorization
- 10:14Database
- 10:54Annotation
- 11:30Validation
- 12:56Structure
- 18:15precedence
- 18:56pointcuts
- 20:44makesense
- 21:20guest
- 21:57crosscutting
- 23:49magic
- 25:11summary
related talks
43m@Eliminate("Boilerplate")
32mWriting Android Libraries
40mIntroduction to Bytecode Instrumentation with AGP 8
38mThe bytecode gobbledygook
39mBytecode Transformations: Exploring new AGP APIs for instrumenting your app
42mWorking Effectively with (Android) Legacy Code
24mAnnotation Processing in Android
34mAndroid or the ART of Optimizing Java Code
