Aspect Oriented Programming (AOP) - A case study in Android

6,485 views

Published on

These are the slides for the talk I gave at Codebits hackathon 2011:
https://codebits.eu/intra/s/session/195
It shows how you can raise the level of abstraction and make your life a lot easier by using AOP (with AspectJ).
Examples are for the Android platform, but are easily ported to other java frameworks.

Published in: Technology
2 Comments
3 Likes
Statistics
Notes
No Downloads
Views
Total views
6,485
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
75
Comments
2
Likes
3
Embeds 0
No embeds

No notes for slide

Aspect Oriented Programming (AOP) - A case study in Android

  1. 1. AOP A case-study in Android by Carlos Anjos anjosc@imeshine.com
  2. 2. Why ?
  3. 3. Developing for Android ● The 5 stages of grief ● Denial – “This can't be that bad, I must be missing something ...” ● Anger – “WTF did they have to reinvent the wheel … for the worse ?!” ● Bargaining – “Maybe I can find a port of my favorite framework for android … Err.... Maybe I can patch it to make it work ...” ● Depression – “Nothing works … nothing will ever work … :'-( Maybe I should stick to doing HTML and Javascript ...“ ● Acceptance – “Oh well … let's start coding !” - «Resistance is futile»
  4. 4. Real men don't eat honey, they chew bees !
  5. 5. What is AOP ?
  6. 6. AspectJ
  7. 7. AspectJ – Java AOP ● Cross-cutting concerns
  8. 8. AOP - Weaving Source: AspectJ in Action
  9. 9. AOP – Like Themes
  10. 10. Concepts •Jointpoint •Pointcut •Advice •Aspect
  11. 11. How AspectJ implements AOP Source code weaving Binary weaving Load Time weaving
  12. 12. How it works
  13. 13. How it works
  14. 14. How it works (with Android)
  15. 15. The case study
  16. 16. AspectJ FTW! }
  17. 17. AspectJ - Level 2
  18. 18. AspectJ – Level 3
  19. 19. AspectJ - Level 4
  20. 20. AspectJ – Level 5
  21. 21. AspectJ – Level 6
  22. 22. AspectJ – Level 7
  23. 23. AspectJ – Level 8
  24. 24. AspectJ – Level 100
  25. 25. AspectJ – Over 9000 ! Paradigm Shift ! Careful … don't try to solve everything with aspects ! OOP is still good ! :-)
  26. 26. “Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” Antoine de Saint-Exupéry
  27. 27. Resources ● AspectJ in Action, Ramnivas Laddad ● http://www.eclipse.org/aspectj/ ● http://www.eclipse.org/ajdt/ ● http://android.imeshine.com/ ● stackoverflow.com ● commonsware.com ● apps.sapo.pt ● developer.android.com
  28. 28. Questions ?

×