SlideServe
Menu
Préférences
© SlideServe · v2026

Software Engineering Lecture 7

yates avatar
9 diapositives · 336 Views · Oct 09, 2014

Software Engineering Lecture 7. Vladimir Safonov , Professor, head of laboratory St. Petersburg University Email: v_o_safonov@mail.ru WWW: http://user.rol.ru/~vsafonov. Aspect-oriented programming (AOP): Aspect. Aspect – an implementation of a crosscutting concern

Software Engineering Lecture 7 - slide 1
01 / 9Software Engineering Lecture 7
1 / 17

Télécharger la présentation

Software Engineering Lecture 7
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. SoftwareEngineeringLecture7 Vladimir Safonov, Professor, head of laboratory St. Petersburg University Email: v_o_safonov@mail.ru WWW: http://user.rol.ru/~vsafonov

  2. Aspect-oriented programming (AOP): Aspect • Aspect – an implementation of acrosscutting concern • Aspect – special kind of a module to be used by itsweaving into other modules • Examples of aspects: - implementation of MT safety for an existing library - implementation of a new source language feature in a compiler So aspects are ubiquitous in programming, but still added and located “by hand”, hence the modularity and maintenance issues (C) Vladimir O. Safonov, 2004

  3. The structure of aspect definition (V. Safonov) • Aspect name • Aspect parameters (optional) – generic aspects desirable • Aspect data • Aspect modules • Aspect actions, with their weaving rules • A separate reusable sets of weaving rules possible, to be used when weaving different aspects (C) Vladimir O. Safonov, 2004

  4. Aspects – static or dynamic? • First view on aspects: Aspect weaving is a kind of “tangled macro expansion”: • Second view: Aspect weaving is performed dynamically, at runtime if Condition then Action (looks like debugging breakpoints – well know for years) • Our viewpoint (V. Safonov): we take the static view but do recognize the dynamic view should be also implemented (C) Vladimir O. Safonov, 2004

  5. Aspects inAspectJ (1/2) • AspectJ: Xerox PARC (1995) -> Univ. of British Columbia, Canada (2003), designed by prof. Gregor Kichales • AspectJ – aspect-oriented extension of Java (compiler from the extended language, debugger in terms of aspects, Aspect GUI) • Pointcut – definition of a group of weaving rules(using wildcards for entity names), - not tied to a concrete code • Join points – concrete points in concrete code to be modified inaspect weaving • Advices – actions to be performed at join points (C) Vladimir O. Safonov, 2004

  6. Aspects inAspectJ (2/2) • Aspects in AspectJ are essentially dynamic (similar to debugging-style breakpoints/debugging actions) • Introduce – weaving new definitions into a module; these definitions are visible by the aspect only (no encapsulation violation happens) • around S A -> B - AspectJstyle of code modification at runtime (self-modifying code); actually, AspectJ behaves as term rewriting system. • Our viewpoint: this is a powerful tool but potentially dangerous (C) Vladimir O. Safonov, 2004

  7. Aspects in Aspect.NET (V. Safonov) • Static approach to AOP very important: it improves program readability • Aspects for .NET should be cross-language • Using custom attributes (AspectDef, AspectRef) • Syntactic sugar: a simple AOP annotations meta-language converted to AOP attributes • Aspectizing (classical term – aspect mining): turning non-AOP programs into AOP ones (coloring the aspects) • Aspect GUI • Aspect.NET site: http://aspect-dot-net.sscli.net (C) Vladimir O. Safonov, 2004

  8. Other new programming paradigms • Logic programming • Functional programming • Event-driven programming • Generic programming • Meta-programming (C) Vladimir O. Safonov, 2004

  9. Home task and references to lecture 7 • http://aosd.net - the main Web site on AOP • http://aspectj.org - theAspectJ Web site • Safonov V. O. Aspect.NET – a new approach to aspect-oriented programming. – In: “.NET Developer’s Journal”, 2003, # 4. (C) Vladimir O. Safonov, 2004