TOPICS FOR THE 541 TEST on Type Systems and Aspect-Oriented Programming Languages $Date: 2003/12/11 18:09:28 $ This exam covers topics from homeworks 4-7, including object-oriented type systems, 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: - 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 OO languages, see - Martin Abadi and Luca Cardelli. A Theory of Objects. Springer-Verlag, NY, 1996. (Chapter 6 and the first 2 pages of chapter 7.) For the semantics of aspects oriented languages, see - Robert E. Filman and Daniel P. Friedman. Aspect-Oriented Programming is Quantification and Obliviousness. In OOPSLA 2000 Workshop on Advanced Separation of Concerns, Minneapolis, MN, Oct, 2000. http://ic.arc.nasa.gov/~filman/text/oif/aop-is.pdf - Curtis Clifton, Gary T. Leavens, and Mitchell Wand. Parameterized Aspect Calculus: A Core Calculus for the Direct Study of Aspect-Oriented Languages. Iowa State University, Department of Computer Science, TR #03-13, Oct. 2003. ftp://ftp.cs.iastate.edu/pub/techreports/TR03-13/TR.pdf 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 almost certain 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 [HW4: FibTracing, BlankLines, FibTiming], or production aspects [HW4: FibMemo] + write aspects that introduce declarations into existing Java code [HW3: problem 7] 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. + Type systems + protocol, behavioral protocol + type, subtype, behavioral subtype + goals of type checking - data type induction - Morris's model of seals ++ Conservative and approximate nature of type systems ++ soundness and completeness of type systems + polymorphism ++ by-name vs. structural type checking (advantages and disadvantages) ++ types of array operations, and why dynamic type checks are necessary for Java array stores ++ contravariant rule for function types ++ record subtyping rules ++ subtyping rule for tuples ++ what is a type environment? how is it used in type checking? ++ concepts needed in type checking for aspect-oriented programming languages; what information is there in a pointcut? What pointcuts "bind" formals? What combinations are disallowed in bindings? [HW5, problem 1] - Describe any problems in type checking AspectJ, e.g., for around advice [HW5, problem 2] + 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) ++ 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, problem 3] ++ 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. ++ 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? + 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. Houses 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 ++ 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 rule-based system 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? + OOP Semantics + Be able to follow a small step semantics, such as the one we used for the lambda calculus, or a big steps semantics, such as the one we used for the object calculus ++ Say when two objects are the same in the object calculus [HW7, problems 1-2] ++ Be able to parse expressions in the object calculus [HW7, problem 3] ++ Using the operational semantics of the object calculus, formally derive the value of an expression in the object calculus [HW7, problems 4 and 8] ++ Desugar terms in the lambda calculus into the object calculus, and vice versa [HW7, problems 5-7] + AOP Semantics - How does the calculus correspond to AspectJ? - What use is the separation of the pointcut description language as a separate parameter? - Why are preceded closures needed? - What information is kept about join points? Why is it needed? - What kind of features in AspectJ can be modeled by select advice? - What is the use of value and update advice?