1 / 6

The Problem With Aspects

The Problem With Aspects. (AOP) A style of programming that attempts to abstract out features common to many parts of the code beyond simple functional modules and thereby improve the quality of software.

burt
Download Presentation

The Problem With Aspects

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. The ProblemWith Aspects (AOP) A style of programming that attempts to abstract out features common to many parts of the code beyond simple functional modules and thereby improve the quality of software. But many systems have properties/concerns that don't necessarily align with the system's functional components, such as failure handling, persistence, communication, replication, coordination, memory management, or real-time constraints, and tend to cut across groups of functional components. While they can be thought about and analysed relatively separately from the basic functionality, programming them using current component-oriented languages tends to result in these aspects being spread throughout the code. The source code becomes a tangled mess of instructions for different purposes. This "tangling" phenomenon is at the heart of much needless complexity in existing software systems. A number of researchers have begun working on approaches to this problem that allow programmers to express each of a system's aspects of concern in a separate and natural form, and then automatically combine those separate descriptions into a final executable form. These approaches have been called aspect-oriented programming. CSC5021: The Problem With Aspects (J P Gibson)

  2. The ProblemWith Aspects Additionalreadingmaterial Aspect-orientedprogramming, Gregor Kiczales, John Lamping, AnuragMendhekar, Chris Maeda, Cristina Lopes, Jean-Marc Loingtier and John Irwin, publishedat ECOOP'97. Gettingstartedwith ASPECTJ, Gregor Kiczales, Erik Hilsdale, Jim Hugunin, MikKersten, Jeffrey Palm, and William Griswold, published in Commun. ACM 44, 10 (October 2001). The paradoxicalsuccess of aspect-orientedprogramming, Friedrich Steimann, publishedat OOPSLA'06. Laddad, Ramnivas. AspectJ in action: practical aspect-oriented programming. Vol. 512. Greenwich: Manning, 2003. CSC5021: The Problem With Aspects (J P Gibson)

  3. The ProblemWith Aspects • A major issue in software engineering isrun-time analysis of code: • Debugging • Monitoring • Profiling • Optimization • Model-checking • Self-* systems and reflection, etc… • Suchanalysis cross-cuts the structure of your system – itweavesthrough all your classes and methods. • One could imagine that Aspects wouldbeuseful in implementingsuchanalysistools. • One couldalso imagine thattrying to do itwithout Aspects would help you to betterunderstandwhy Aspects are useful. CSC5021: The Problem With Aspects (J P Gibson)

  4. The ProblemWith Aspects • You are to choose a Java program whichrequiresdynamicanalysis: • Not toosmallnortoobig • No user-interaction required • Executesrandomly (and youcan control the randomseed) • A good examplewouldbe the code for running XO gamesbetweenrandomplayerswhichyoudeveloped last year • Addprofiling code to: • Log and count method calls • Log and count object instances for a particular class • Generate an error log for when an invariant isbroken (or exception arises) • Test that the profile code isworkingcorrectly (withoutbreaking the original functionality of the system beforeitwasprofiled). • (If you know about existing Java profilersyoumaywish to test yourresultsagainstthese) CSC5021: The Problem With Aspects (J P Gibson)

  5. The ProblemWith Aspects There isprobably a lot of repetitive code re-use in yourprevious solution. (Coulditbe a design pattern?) Consider how youcouldwrite a program thatwouldgenerate the profiling code automatically. Take one of the profilingproperties (the easiest?) and write a program thattakes an unprofiled Java program as input and produces the correspondingprofiled Java program. Test this program againstyourmanuallywritten code for the previousproblem. Does the profile generatorwork for other programs? Would the generated code beeasy to maintain? In the next lecture wewillsee how thiscanbedonesimplyusingAspectJ (an extension to Java). Wewillalsoseethatsuch aspects can do much more thanjustprofiling. CSC5021: The Problem With Aspects (J P Gibson)

  6. The ProblemWith Aspects: You have built a simplistic aspect weaver Useful Links AOSD.net http://dx.doi.org.gate6.inist.fr/10.1145/242224.242420 CSC5021: The Problem With Aspects (J P Gibson)

More Related