TOPICS FOR THE 541 TEST on Aspect-Oriented Programming Languages $Date: 2004/12/08 00:47:11 $ This exam covers topics from homework 5, including AspectJ, aspect-oriented programming, and semantics of aspect-oriented languages. REMINDERS The exam will be open book, open notes. (Warning: don't expect to learn the material during the exam, you won't have time! A good idea for studying is to condense your notes to a few pages of ready reference materials.) If you need more space, use the back of a page. Note when you do that on the front. This exam is timed. We will not grade your exam if you try to take more than the time allowed. Therefore, before you begin, please take a moment to look over the entire exam so that you can budget your time. Clarity is important; if your diagrams or programs are sloppy and hard to read, you will lose points. Correct syntax also makes a difference for programming questions. READINGS For AspectJ, primarily, you should read: - Ramnivas Laddad. AspectJ in Action: Practical Aspect-Oriented Programming. Manning, Greenwich, CT, 2003. (Especially chapters 1-4 and 8.) - The AspectJ(TM) Programming Guide (http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/aspectj-home/doc/progguide/index.html); - Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold, "An Overview of AspectJ," In J. Lindskov Knudsen (ed.), ECOOP 2001 --- Object-Oriented Programming 15th European Conference, Budapest Hungary, pages 327-353, Volume 2072 of Lecture Notes in Computer Science, Springer-Verlag, Berlin, June, 1997 (http://www.parc.com/research/csl/projects/aspectj/downloads/ECOOP2001-Overview.pdf); - Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold, Getting started with AspectJ, Communications of the ACM, Vol 44, num 10, pp. 59-65, Oct. 2001 (http://doi.acm.org/10.1145/383845.383858). For the semantics of aspects oriented languages, see - Robert E. Filman and Daniel P. Friedman. Aspect-Oriented Programming is Quantification and Obliviousness. In Mehmet Aksit and Siobhan Clarke and Tzilla Elrad and Robert E. Filman, Aspect-Oriented Software Development, Addison-Wesley, Reading, MA, 2004. If you have time, see the course web site and also the course syllabus for other readings. TOPICS In the following, I use + to denote relatively more important topics, and - to denote relatively less important topics. Topics marked with ++ are very likely to be on the exam. All of these are fair game, but if you have limited time, concentrate on the ones that are more important first (and in those, the ones you are most uncertain about). SKILLS + AspectJ programming; be able to: + give output of AspectJ code, especially for code that uses pointcuts and advice ++ write aspects that advise existing Java code, for example, to write development aspects [HW5: FibTracing, BlankLines, FibTiming, TraceBeta], or production aspects [HW5: FibMemo, BigStep's evaluate, eta reduction advice] ++ write aspects that introduce declarations into existing Java code [HW5: introduction of test method, boundVars method] + write aspects that declare precedence ordering between aspects [HW5: FibTiming and BlankLines] TERMS AND CONCEPTS You should be able to explain and use (in problems or essays) the following concepts (with appropriate comparisons to related concepts). You should be able to give examples of these concepts. + AOP design and general concepts + What is a cross-cutting concern? Give an example + What is tangling? Give an example. + How is AOP better than use of the observer pattern? ++ What kinds of AspectJ features replace the observer pattern and are useful for logging, debugging, etc.? ++ What kinds of AspectJ features are used to implement performance improvements, like cacheing, buffering, pooling, etc.? ++ Describe the advantages of a programming language approach, such as AspectJ, as opposed to approaches outside of a language, such as edting scripts. - How does AOP help deal with non-functional concerns? + How does AOP relate to OOP? - What uses are typical for AOP? + AspectJ semantics + Describe the meaning of AspectJ's identifier patterns. + Describe the meaning of AspectJ's type patterns. Say what types are matched by a pattern. + Describe the meaning of AspectJ's signature (method or constructor) patterns. Say what methods are matched by such a pattern. + What is a join point? What kinds of join points are dynamic in AspectJ? + Describe the meaning of each kind of AspectJ pointcut. ++ Be able to interpret or write code that declares pointcuts. ++ Explain how context exposure works in AspectJ. (args, this, target) [HW5: this and target in execution pointcuts, binding forms in advice] + How do you avoid advice that applies to itself? + What purpose do the formals in pointcut declarations serve in AspectJ? + What good are abstract point cuts? + What are the kinds of advice in AspectJ? + What are the best ways to use each kind of advice? + Describe the meaning of different kinds of advice. + What kinds of advice are sugars for other kinds of advice? How would you do the desugaring? [HW5 use before/after instead of around or vice versa] + What does proceed do? Where can it be used? + What use is thisJoinPoint, and thisJoinPointStaticPart? + What use is a privileged aspect? + What use is an abstract aspect? - What use are pertarget, perthis, etc? + Describe the kinds of behavioral changes that advice can make in AspectJ. + Type checking rules for AspectJ [HW5: type checking rules for arrayfetch joinpoint] ++ How can one use AspectJ to help glue independently developed libraries of code together? ++ What are the various kinds of static introductions in AspectJ? What do they do? ++ How can one use AspectJ to enforce programming rules, such as layering of software? [HW5: rule that package b can't call a] + What are the various kinds of "declare" declarations in AspectJ? What do they do? + How can one use AspectJ to change how exceptions are propagated or handled? ++ Explain the precedence concept in AspectJ. How does the "declare precedence" declaration work? When is it needed? - Consider some feature like one in AspectJ, and explain how it could be incorporated into an aspect-oriented version of Smalltalk or Haskell + AOP Semantics + What is quantification in aspect-oriented languages? Can you give examples from Smalltalk or AspectJ? + What is obliviousness in aspect-oriented languages? Can you give examples from Smalltalk or AspectJ? + Why is obliviousness a good thing? + Give an example of a feature of Smalltalk or Haskell that is definitely not aspect-oriented. + Is a logic programming language aspect oriented? An event-based publish and subscribe system where events are explicitly signaled? + What is dynamic quantification? Why is it useful? + What is modular reasoning? Why is it useful? + What reasoning principle helps deal with obliviousness due to dynamic dispatch in object-oriented programs? - What's the idea in the spectators and assistants paper?