COP 4020 Lecture -*- Outline -*- * Explicit State (Ch 6) Based on Peter van Roy and Seif Haridi's book, "Concepts, Techniques, and Models of Computer Programming" (MIT Press, 2004), where all references that are not otherwise attributed are found. ** self-test ------------------------------------------ SELF-TEST FOR CHAPTER 6 Concepts [Concepts] [EvaluateModels] What is the difference between declarative and imperative programming? Utility [EvaluateModels] What are the advantages of explicit state? Abstraction [EvaluateModels] How does explicit state help abstraction? Encapsulation? Model [Concepts] How are cells modeled? Exchange [Concepts] [EvaluateModels] How do you get assignment from the Exchange primitive? Access? Vs. Declarative [Concepts] Is programming with state declarative? Why or why not? Vs. Declarative [Concepts] Can program that uses state be declarative? Aliasing [Concepts] [EvaluateModels] What is an alias? What problems can it cause? Equality [Concepts] What is the difference between structural and token equality? Which is used for cells? Data abstraction [Concepts] [EvaluateModels] What is a data abstraction? How does it differ from an ADT? Object? Data abstraction organization [UseModels] What are the different ways to organize a data abstraction? What are their advantages and disadvantages? Polymorphism [Concepts] [UseModels] What is polymorphism? What is ad hoc polymorphism? How is it achieved with different organizations of data abstractions? Binary methods [Concepts] [EvaluateModels] What is a binary method? How do the different data abstraction organizations differ in their treatment of binary methods? Parameter passing [Concepts] [EvaluateModels] [MapToLanguages] Describe how each parameter passing mechanism works: call by value, reference, value-result, result, name, and need. Which are in C, C++, and Java? What are the advantages of each? Revocable capabilities [Concepts] [UseModels] How can you get a revocable capability using cells? ------------------------------------------