Slide 1

Slide 1 text

Aspect Oriented Programming Frodo Android Library + @fernando_cejas http://www.fernandocejas.com

Slide 2

Slide 2 text

Aspect Oriented Programming title, date, 01 of 10 In computing, aspect-oriented programming (AOP) is a patented programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns. https://github.com/android10/frodo

Slide 3

Slide 3 text

AOP Terminology title, date, 01 of 10 ● Cross-cutting concerns: Cohesive areas of functionality across an application. ● Advice: The code that is injected to a class file. ● Joint point: A particular point in a program that might be the target of code injection. ● Pointcut: An expression which tells a code injection tool where to inject a particular piece of code. ● Aspect: The combination of the pointcut and the advice is termed an aspect. ● Weaving: The process of injecting code – advices – into the target places – joint points.

Slide 4

Slide 4 text

AOP Terminology title, date, 01 of 10

Slide 5

Slide 5 text

Where can we apply AOP? title, date, 01 of 10 ● Logging ● Persistence ● Performance monitoring ● Data Validation ● Caching ● Etc... https://github.com/android10/frodo

Slide 6

Slide 6 text

Where does the magic happen? title, date, 01 of 10 ● Run-time ● Load-time ● Build-time https://github.com/android10/frodo

Slide 7

Slide 7 text

Tools and Libraries title, date, 01 of 10 ● AspectJ: A seamless aspect-oriented extension to the Javatm programming language (works with Android). ● Javassist for Android: An android porting of the very well known java library Javassist for bytecode manipulation. ● DexMaker: A Java-language API for doing compile time or runtime code generation targeting the Dalvik VM. ● ASMDEX: A bytecode manipulation library as ASM but it handles the DEX bytecode used by Android executables.

Slide 8

Slide 8 text

Why AspectJ? title, date, 01 of 10 ● Very powerful. ● Supports build time and load time code injection. ● Easy to use. https://github.com/android10/frodo

Slide 9

Slide 9 text

title, date, 01 of 10 Frodo

Slide 10

Slide 10 text

Frodo title, date, 01 of 10 It is an aspect oriented library for logging/tracing based on Annotations: ● @RxLogObservable ● @RxLogSubscriber https://github.com/android10/frodo

Slide 11

Slide 11 text

Frodo title, date, 01 of 10 https://github.com/android10/frodo

Slide 12

Slide 12 text

Frodo title, date, 01 of 10

Slide 13

Slide 13 text

Frodo title, date, 01 of 10 ● Annotations Module ● Library Runtime ● Gradle Plugin

Slide 14

Slide 14 text

How to use Frodo? title, date, 01 of 10 https://github.com/android10/frodo

Slide 15

Slide 15 text

How to use Frodo? title, date, 01 of 10

Slide 16

Slide 16 text

Frodo title, date, 01 of 10 ● Generated code? ● Performance?

Slide 17

Slide 17 text

Thanks! title, date, 01 of 10 http://www.fernandocejas.com/