Greg Sullivan will be our guest speaker. His topic will be "Design Patterns in a Dynamic Language". Read the paper in advance of class.
Monday April 1, 2002
The second exercise is available
here. It's due on Wednesday April 17.
Read the 1997 ECOOP papers on feature-oriented and aspect-oriented programming. You may also want to read the more recent paper on Aspect-J, which applies aspects to Java. More information on aspects is available at
www.aosd.net, and on AspectJ at
www.aspectj.org.
-
Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Videira Lopes, Jean-Marc Loingtier, and John Irwin.Aspect-Oriented Programming.
Proceedings of the European Conference on Object-Oriented Programming
(ECOOP), Finland. Springer-Verlag LNCS 1241. June 1997.
Available here.
-
G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of aspectj. In ECOOP, pages 327-353, 2001.
Available here.
-
Christian Prehofer. Feature-Oriented Programming: A Fresh Look at Objects. Proceedings of the European Conference on Object-Oriented Programming
(ECOOP), Finland. Springer-Verlag LNCS 1241. June 1997.
Available here.
Then answer these questions:
-
What's the difference between an aspect and a feature?
-
Could aspects be the fundamental structuring mechanism of a program, or are they always an add-on, something considered afterwards for incremental development?
-
Are aspects and features compatible with the paradigm of object-oriented programming? Would they be more or less easily implemented in Objective CAML?
Wednesday March 20, 2002
In class, we'll discuss the module system of Objective Caml, which is based on that of Standard ML, but with better support for separate compilation. To prepare for this, read Leroy's paper:
-
Xavier Leroy. Manifest Types, Modules and Separate Compilation. Proc. 21st Symposium on Principles of Programming Languages (POPL), 1194, pp. 109--122.
Available here.
For background on what structures, signatures and functors are all about, read the relevant parts of Bob Harper's book on programming with Standard ML, which is full of insights and wonderful examples, and is very clearly explained. Part 3 explains the module system. If you plan to use OCaml in your programming exercise, you should also read the relevant parts of the OCaml manual. Part 1 is a tutorial; Chapter 2 is about modules. It doesn't explain much, but it does give some nice examples.
Robert Harper. Programming in Standard ML. Latest draft, March 4, 2002. Available
here, or at http://www.cs.cmu.edu/~rwh/.
-
Xavier Leroy, with Damien Doligez, Jacques Garrigue, Didier Remy and Jerome Vouillon.
The Objective Caml System. Release 3.04. Documentation and User's Manual. December 10, 2001. Institut National de Recherche en Informatique et en Automatique (INRIA).
Available
here, or at http://caml.inria.fr/ocaml/htmlman.
-
To really get to grips with Caml, download the distribution and play with it. You'll find distributions and much more at http://www.ocaml.org.
Then answer these questions:
-
What practical advantages does ML's module system offer over Java's? Some issues to consider: separate compilation; interfaces vs. classes; exporting types, exceptions and values together; whether packages have specifications; making dependences explicit.
-
ML uses sharing constraints to solve the 'diamond import problem'. Where do sharing constraints crop up in Units? Why are they not needed in Java?
Wednesday March 13, 2002
Read these papers:
-
R. Findler and M. Flatt. Modular Object-Oriented Programming with Units and Mixins.
International Conference on Functional Programming, 1998.
Available here.
-
M. Flatt, and M. Felleisen. Units: Cool modules for HOT languages. In Proc. Sigplan 1998 Conference on Programming Language Design and Implementation, 236--248.
Available here.
-
S. McDirmid, M. Flatt, and W. Hsieh. Jiazzi: New Age Components for Old Fashioned Java. In Proc. of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) 2001.
Available here.
For an interesting application of units, optionally read this one too:
-
Reid, Flatt, Stoller, Lepreau, and Eide. Knit: Component Composition for Systems Software. OSDI 2000.
Available here.
Then answer these questions:
-
Compare the linking model in units to Cardelli's theoretical model. What are some of the key differences? Consider things like ability to hide fragments, packaging exports into groups, subtyping, mutual references, etc.
-
In the mixins paper, Findler and Flatt say that "... support [for] external connections [is] crucial to software engineering" (Section 7, Page 8). What does this mean? Does Java provide it? And do you believe this claim?
-
The units framework allows linking to be done at runtime, with the links selected dynamically. What useful things could be done with this feature?
Monday March 11, 2002
Read Cardelli's paper:
-
Luca Cardelli. Program Fragments, Linking, and Modularization. POPL 97.
Available here.
Don't be intimidated by the volume of mathematical material; the paper's actually very straightforward. It gives a formal model of linking that treats the linking step as substitution of an expression for a variable; this allows the standard technique for describing type checking in lambda calculus to be applied to type checks within and across modules. (If you're not familiar with basic notions of lambda calculus and type inference, though, you may find it a bit of a struggle.) Answer these questions:
-
Cardelli asks "When does a module system really support modularization?". What does he mean by "modularization", and what else would a module system offer?
-
Give an example of a linkset with two different linking paths (that is, two different sequences of steps that resolve the cross references between modules).
-
What does the restriction in Definition 6.1 -- that one of the environments involved must be empty -- mean in practice?
-
Suppose linking were not confluent. What problems would this cause in practice?
-
How well does this theory fit the linking model of Java?
Wednesday March 6, 2002
Read the paper about problem frames:
-
Michael Jackson. Problem Analysis and Structure. In Proceedings of NATO Summer School, Marktoberdorf, August 2000.
Available here.
Then answer these questions:
-
Jackson says: "Even methods and approaches that claim the title of 'problem analysis' usually prove, on closer inspection, to deal entirely with putative or outline solutions." Does this criticism apply to Fowler's Analysis Patterns?
-
What are the domains and shared phenomena in your lift description? Which problem frames fit it?
Monday March 4, 2002
Read the chapters from Fowler's book, and the new chapter on Accountability patterns (but feel free to skip the implementation discussions):
- Martin Fowler. Analysis Patterns: Reusable Object Models. Addison Wesley Longman, 1997. Chapters 1 and 5.
-
Martin Fowler. Accountability Patterns. New version of Chapter 2, of Analysis Patterns. Available at
www.martinfowler.com, or
here.
Then answer these questions:
-
What exactly are these patterns of? Who would use them?
-
Give an example of an instance of one of the accountability patterns in the organization of MIT.
-
Make precise some of the "uniqueness constraints" discussed in the Identification Scheme pattern of Chapter 5 using Alloy.
Wednesday February 27, 2002
Read the following:
- J. Michael Spivey. An Introduction to Z and Formal Specifications. Software Engineering Journal IEE/BCS, 1989. Vol 4, No 1, pp. 40-50.
Available here.
-
J. Michael Spivey. Specifying a Real-Time Kernel. IEEE Software, September, 1990, pp. 21-28.
Available here.
-
J.C.P. Woodcock. Structuring Specifications in Z. Software Engineering Journal
IEE/BCS, 1989. Vol 4, No 1, pp. 51-66.
Available here.
Read enough of the following to get some idea of what ASMs are about:
[G93]
Yuri Gurevich. Abstract State Machines: The ASM Tutorial. Or: "Evolving Algebras: An Attempt to Discover Semantics". Current Trends in Theoretical Computer Science, eds. G. Rozenberg and A. Salomaa, World Scientific, 1993, 266-292.
Available here. See also the ASM website: http://www.eecs.umich.edu/gasm/.
Look into OCL, the constraint language of UML, by reading some of the stuff on IBM's web site http://www-3.ibm.com/software/ad/library/standards/ocl.html.
Also look at the support for OCL offered by the University of Bremen's USE tool:
http://www.db.informatik.uni-bremen.de/projects/USE/.
Answer the following questions:
-
How do signatures in Alloy compare to schemas in Z? Are there things you can do with schemas but not with signatures, and vice versa?
-
Do you accept the argument that OCL is simpler and easier to use than Z because it's less mathematical?
-
What does the USE tool do? How does this compare to the Alloy Analyzer?
-
Which of these languages (OCL, Z, ASM, Alloy) is appropriate for modelling object-oriented systems?
Monday February 25, 2002
Exercise 1 is due at the start of class today.
Wednesday February 20, 2002
The first exercise is now available
here. It's due on Monday February 25th, but I strongly encourage you to start it early. First, it's quite challenging, and if you leave it until the last minute, you may not get it done. Second, it should be fun, and you won't enjoy it if you're under pressure. Third, I find that elapsed time helps: if you get stuck, a day away from it will clear your mind and your subconscious may well get you unstuck. Fourth, you'll benefit from the peer review meeting on February 20th if you've already thought about the problem. You should aim to have at least started the main problem (the Elevator System design) by that date.
Wednesday February 13, 2002
Read the following:
-
[JS00]
Daniel Jackson and Kevin Sullivan. COM Revisited: Tool-Assisted Modelling and Analysis of Complex Software Structures. ACM SIGSOFT Conference on Foundations of Software Engineering, San Diego, CA, November 2000.
Available at: http://theory.lcs.mit.edu/~dnj/publications.html#com.
-
[KJ00]
Sarfraz Khurshid and Daniel Jackson. Exploring the Design of an Intentional Naming Scheme with an Automatic Constraint Analyzer. Proc. 15th IEEE International Conference on Automated Software Engineering, Grenoble, France, September 2000.
Available at: http://theory.lcs.mit.edu/~dnj/publications.html#ase-00.
-
A model of the leader election phase of the Firewire protocol. Daniel Jackson, January 2002. Available at http://theory.lcs.mit.edu/~dnj/6898/models/firewire.als. This model uses orderings defined in another module, available at http://sdg.lcs.mit.edu/alloy/models/ord.als, but you should be able to understand what's going on without reading this other module. The basic idea is very simple: the model defines states, and uses orderings to define a sequence of states, with a first state, a last state, and relation that maps each state except the last to the one that follows it.
-
A model of a simple distributed spanning tree algorithm. Ilya Shlyakhter and Manu Sridharan, January 2002. Available at http://theory.lcs.mit.edu/~dnj/6898/models/opt_spantree.als. This model also uses orderings.
Answer the following questions:
-
What's one key difference between the style of the Firewire and spanning tree models on the one hand, and the style of the INS model on the other? What are the pragmatic consequences of this difference?
-
You could imagine analyzing INS, Firewire or the spanning tree, using a simulator: write the algorithms in code, and explore executions by some kind of backtracking search. Why is the Alloy Analyzer's analysis more powerful than this? And why couldn't you do this kind of simulation for the COM example?
-
Are there parts of these models that you found obscure or hard to understand? If so, which?
Monday February 11, 2002
Read the following items:
- [J02]
Daniel Jackson. Micromodels of Software: Lightweight Modelling and Analysis with Alloy. February 2002.
Available at: http://sdg.lcs.mit.edu/alloy/book.pdf. This is a draft of a book. Read Chapters 1, 2 and 3.
-
[JSS02]
Daniel Jackson, Ilya Shlyakhter and Manu Sridharan. A Micromodularity Mechanism. ACM SIGSOFT Conference on Foundations of Software Engineering / European Software Engineering Conference, Vienna, September 2001.
Available at: http://theory.lcs.mit.edu/~dnj/publications.html#micromodularity.
This paper describes the key structuring mechanism in Alloy -- the signature. It's much shorter than the relevant book chapters (2 and 3), but people say they find it hard going, perhaps because it's too succinct.
-
[J00]
Daniel Jackson. Automating Relational Logic. ACM SIGSOFT Conference on Foundations of Software Engineering, San Diego, CA, November 2000.
Available at: http://theory.lcs.mit.edu/~dnj/publications.html#alcoa-algorithm.
This paper explains the technology that underlies the Alloy Analyzer. Since the analyzer compiles Alloy into an intermediate language that's essentially the relational logic I presented in the first lecture, yuo don't need to understand the full language to make sense of it. If you really want to understand how the analysis works, read this carefully (although you can skip some of the complicated stuff about representing environments as trees). For this class, you don't need to understand how the analyzer works, but you might want to skim this paper anyway.
Answer the following questions:
-
In Alloy, an expression always denotes a relation. Suppose Alloy had a built-in notion of scalars as well, so the meaning of an expression could be a single atom. What effect would this have on the syntax of the language? Would it make the language more expressive?
-
I chose to use a dot for relational join in Alloy, so that navigation expressions would look familiar to programmers. How do the dot in Alloy and the field dereferencing dot in Java differ?
-
To check that you really understand the relational operators, try and express the following two constraints without using quantifiers:
-
Every Course 6 student takes some (that is, at least one) Course 6 class.
-
Every geek takes every Course 6 class.
You can assume that we have basic types STUDENT, CLASS and COURSE, and the following relations: _takes_, a binary relation from STUDENT to CLASS that maps s to c when s takes class c; _course_, a binary relation from CLASS to COURSE that maps cl to co when cl is a class in MIT course co; _Six_, a unary relation on COURSE that contains a single tuple, and which represents Course 6; _SixStudents_, a unary relation on STUDENT which represents the set of students enrolled in Course 6; and _Geek_, a unary relation on STUDENT which represents the set of students who are geeks.