1 / 32

Aspect Oriented Programming

Aspect Oriented Programming. An Introduction based on se-radio.net episode 106. Agenda. Separation of concerns and the need for AOP AOP by example Join point models & weaving se.radio.net Episode 106 Questions & answers session. Separation of concerns.

ova
Télécharger la présentation

Aspect Oriented Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aspect Oriented Programming An Introduction based on se-radio.net episode 106 Aspect Oriented Programming - Nils Schmidt

  2. Agenda • Separation of concerns and the need for AOP • AOP by example • Join point models & weaving • se.radio.net Episode 106 • Questions & answers session Aspect Oriented Programming - Nils Schmidt

  3. Separation of concerns “Separation of concerns is a fundamental principal of software design and implementation” [1] • it helps structuring code according to requirements • it improves maintainability of software • It has been a driving factor for new paradigms, patterns etc. Ideal Situation: Each element of source code serves exactly one concern Aspect Oriented Programming - Nils Schmidt

  4. Separation of concerns – Some approaches Internet Protocol Suite Component Servers Functional Programming Data Structures Service Orientation Procedural Programming Model View Controller Structured Programming Modular Programming Aspect Oriented Programming Web Services Subroutines Object Orientation Model View Controller Separation of rooms using corridors Aspect Oriented Programming - Nils Schmidt

  5. Crosscutting concerns - The need for AOP Software is usually modularized according to its core concerns (its main functionality) Mathematics Software System Prime Number Creation Sort Algorithms Matrix Chain Multipl. … Aspect Oriented Programming - Nils Schmidt

  6. Crosscutting concerns - The need for AOP Software is usually modularized according to its core concerns (its main functionality) Core concerns Mathematics Software System Prime Number Creation Sort Algorithms Matrix Chain Multipl. … Aspect Oriented Programming - Nils Schmidt

  7. Crosscutting concerns - The need for AOP “Any structural realization of a system will find that some concerns […] cross multiple elements. AOP is focused on mechanisms for simplifying the realization of such crosscutting concerns.” [2] Core concerns Mathematics Software System Prime Number Creation Sort Algorithms Matrix Chain Multipl. … Aspect Oriented Programming - Nils Schmidt

  8. Crosscutting concerns - The need for AOP “Any structural realization of a system will find that some concerns […] cross multiple elements. AOP is focused on mechanisms for simplifying the realization of such crosscutting concerns.” [2] Core concerns Mathematics Software System Prime Number Creation Sort Algorithms Matrix Chain Multipl. Caching Security Profiling … Aspect Oriented Programming - Nils Schmidt

  9. Crosscutting concerns - The need for AOP “Any structural realization of a system will find that some concerns […] cross multiple elements. AOP is focused on mechanisms for simplifying the realization of such crosscutting concerns.” [2] Core concerns Mathematics Software System Prime Number Creation Sort Algorithms Matrix Chain Multipl. Crosscutting concerns Caching Security Profiling … Aspect Oriented Programming - Nils Schmidt

  10. AOP by Example • Matrix Chain Multiplication Solver • Calculates minimal number of elementary multiplications needed for multiplying a sequence of matrices • Use dynamic programming (caching) • Use time consumption analysis (profiling) Aspect Oriented Programming - Nils Schmidt

  11. Aspect Oriented Programming - Nils Schmidt

  12. Core concern (MCMS) Caching concern Profiling concern Base code is tangled by crosscutting concerns Hard to maintain! Aspect Oriented Programming - Nils Schmidt

  13. Only the core concern is left in the class No further concerns are present anymore Easier to maintain! But where did the crosscutting concerns go? Aspect Oriented Programming - Nils Schmidt

  14. Crosscutting concerns are moved into so called aspects Aspect Oriented Programming - Nils Schmidt

  15. Crosscutting concerns are moved into so called aspects An aspect is a basic concept (similar to a class); it is composed of pointcuts and advices. Aspect Oriented Programming - Nils Schmidt

  16. Crosscutting concerns are moved into so called aspects An aspect is a basic concept (similar to a class); it is composed of pointcuts and advices. A pointcut defines when in the execution model the aspect needs to be applied. Aspect Oriented Programming - Nils Schmidt

  17. Crosscutting concerns are moved into so called aspects An aspect is a basic concept (similar to a class); it is composed of pointcuts and advices. A pointcut defines when in the execution model the aspect needs to be applied. An advice defines what needs to be applied to the execution model. Aspect Oriented Programming - Nils Schmidt

  18. Join Point Models • A join point is a specific point in the execution model of a program • A pointcut is a query that selects a subset of all join points in the execution model • A join point model defines which join points could be selected by a pointcut (e.g. method calls, variables …) • The more powerful the join point model is, the more one can do with that AO language Aspect Oriented Programming - Nils Schmidt

  19. Weaving • Weaving is the process of reconnecting the separated concerns (core elements + aspects) • Weaving might be done at compile-time, load-time or run-time of a system Weaver Aspect Oriented Programming - Nils Schmidt

  20. se-radio.net Episode 106 - Speakers Aspect Oriented Programming - Nils Schmidt

  21. se-radio.net Episode 106 - Content (shortened) Aspect Oriented Programming - Nils Schmidt

  22. se-radio.net Episode 106 - Content (shortened) Aspect Oriented Programming - Nils Schmidt

  23. se-radio.net Episode 106 - Content (shortened) Aspect Oriented Programming - Nils Schmidt

  24. se-radio.net Episode 106 - Content (shortened) Aspect Oriented Programming - Nils Schmidt

  25. se-radio.net Episode 106 - Content (shortened) Aspect Oriented Programming - Nils Schmidt

  26. se-radio.net Episode 106 - Content (shortened) Aspect Oriented Programming - Nils Schmidt

  27. se-radio.net Episode 106 - Content (shortened) Aspect Oriented Programming - Nils Schmidt

  28. Cut-Outs Parts that have been cut out of the original se-radio.net episode 106: • Characteristics of concerns • Business vs. software concerns • Technical vs. functional concerns • Characteristics of aspects • Asymmetric vs. symmetric aspects • Heterogeneous vs. homogenous aspects • Developmental vs. productive aspects • Aspect ordering • Sophisticated pointcut models • Some Real World Examples • Tools for AOP • Research Languages Aspect Oriented Programming - Nils Schmidt

  29. Summary • Separation of concerns is an essential concept to improve maintainability • AOP provides a well defined model to deal with crosscutting concerns • AOP increases overall maintainability • Aspects, Advices, pointcuts and joint points are the backbone of AOP • The more powerful your joint point model is, the more you can do with it • Weaving might be applied at different times and levels • You need to think AO before you can program AO • AOP is still a research topic, but yet a business relevant topic as well Aspect Oriented Programming - Nils Schmidt

  30. Questions & Answers Aspect Oriented Programming - Nils Schmidt

  31. Literature & Further Material • GregorKiczales. Aspect Oriented Programming: Radical Research in Modularity. May 2006 ,Web Video. http://video.google.com/videoplay?docid=8566923311315412414# • Tzilla Elrad and Robert E. Filman and Atef Bader. „Aspect-orientedprogramming“ ACM Computing Surveys 44.10 (Oct. 2001): 29-32. Print. • G. Kiczalesand J. Lamping andA. Mendhekarand C. Maeda and C. Lopes and J. Loingtierand . Irwin. „Aspect-OrientedProgramming“ Proceedings of the European Conference on Object-Oriented Programming (1997): 220-242. Print. • Ian Sommerville. Software Engineering. Addison Wesley, 8th edition, Jun. 2006. Print. • „Aspect-orientedprogramming“ Wikipedia, thefreeencyclopedia. Web. http://en.wikipedia.org/wiki/Aspect-oriented_programming/ • Aspect-Oriented Software Development Community & Conference. Web. http://www.aosd.net/ • RamnivasLaddad. AspectJ in Action. Manning Publications, 2nd edition, Sep. 2009. Print. • Siobhán Clarke and Elisa Baniassad. Aspect-Oriented Analysis and Design: The Theme Approach. Addison-Wesley Professional, Apr. 2005. Print. • Vladimir O. Safonov. Using Aspect-Oriented Programming for Trustworthy Software Development.Wiley-Interscience, May 2008. Print. Aspect Oriented Programming - Nils Schmidt

  32. Bibliography [1] Ian Sommerville. Software Engineering. Addison Wesley, 8th edition, Jun. 2006. Print. [2] Tzilla Elrad and Robert E. Filman and Atef Bader. „Aspect-orientedprogramming“ ACM Computing Surveys 44.10 (Oct. 2001): 29-32. Print. Aspect Oriented Programming - Nils Schmidt

More Related