Recommended Memory Management: What You Need to Know When Moving to Java 8
Kodgranskning - i en agil miljö
Java 8 Launch - MetaSpaces
A topology of memory leaks on the JVM
Java GC, Off-heap workshop
2024 Trend Updates: What Really Works In SEO & Content Marketing
Storytelling For The Web: Integrate Storytelling in your Design Process
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
More Related Content Memory Management: What You Need to Know When Moving to Java 8
Kodgranskning - i en agil miljö
Java 8 Launch - MetaSpaces
A topology of memory leaks on the JVM
Java GC, Off-heap workshop
Featured (20) 2024 Trend Updates: What Really Works In SEO & Content Marketing
Storytelling For The Web: Integrate Storytelling in your Design Process
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
Introduktion till Aspekt-orienterad programmering (AOP) med AspectJ3. Kort historik
AspectJ (2001)
AspectWerkz (2002)
AspectJ 1.5 (2005)
Mattias Jiderhamn
4. Hög tröskel
Recept för AOP:
1 del Mumbo Jumbo
1 del Hokus Pokus
Recipie for
disaster…?
Mattias Jiderhamn
5. Mumbo Jumbo
• Cross-cutting concern
• Join point
• Pointcut
• Advice
• Aspect
• Weaving
• Inter-type declaration
• Mixin
• cflow
Mattias Jiderhamn
6. Cross-cutting concern
Behov som går på tvären igenom
flera lager och/eller moduler.
Exempel:
•Loggning
•Auktorisering
•Transaktioner
•Datavalidering
Mattias Jiderhamn
7. Join point
Punkter där det är möjligt
att applicera ett
cross-cutting concern
AOP LINE - DO CROSS AOP LINE - DO CROSS
Exempel: metodanrop
Mattias Jiderhamn
8. Cross-cutting concern
Loggning Behörighet Transaktioner
Artikel
modul
Join point
Kund-modul
Data-access
REST API
Mattias Jiderhamn
9. Pointcut
Deklarationen av en join point.
Definierar var skall något hända.
Tillåter ofta kombinationer
av flera join points.
Exempel: ”när metoden B.a() anropas
ELLER exceptionet Foo fångas i
klassen Bar”
Mattias Jiderhamn
10. Advice
Implementationen av ett
cross-cutting concern
Vad skall hända
Mattias Jiderhamn
11. Aspect
Modul innehållande
pointcuts och advice
Var + Vad
Mattias Jiderhamn
12. Weaving
Processen när advice appliceras
på angivna pointcuts
”Advised”
Klass A Weaving Klass A’
Mattias Jiderhamn
13. Inter-type declaration
Lägg till deklarationer till en eller flera
(redan kompilerade) klasser
•Fält
•Metoder
•Konstruktorer
•Interface
•Bas-klasser (”multipelt arv”)
Mattias Jiderhamn
16. Hokus Pokus
• Älskar Java och Open Source pga
avsaknaden av Hokus Pokus
• Få undantag (serialization)
• AOP innebär Hokus Pokus…
Mattias Jiderhamn
17. Fyra metoder
• Proxy + InvocationHandler
• CGLIB
• java.lang.instrument + -javaagent
• Compile time weaving (”riktig AOP”)
Mattias Jiderhamn
18. Två syntaxer
• .aj (AspectJ)
• Annoteringar (AspectWerkz)
Mattias Jiderhamn
19. .aj
aspect Logging {
pointcut pc() : execution(public
static void main(String[]));
before() : pc() {
System.out.println(”foo");
}
}
Mattias Jiderhamn
21. call() vs execution()
call()
class A { class B {
void a() { void b() {
b.b(); ...
} }
} }
execution()
Mattias Jiderhamn
22. Avslutande råd
• AOP + TDD = sant
• Använd AOP med måtta
Mattias Jiderhamn