47. Understanding Existing Code
In this exercise session, you will practice how to approach a system and understand it.
Download Pharo with Pillar from the Pillar website on Smalltalkhub http://www.smalltalkhub.com/#!/~Pier/Pillar.
To answer the following questions. We sugget that you use the different navigation tools of Pharo looking
for class references (references), method implementations (implementers) and message sent (senders).
47.2. High-Level Structure
- Draw a package diagram explaining which package depends on which one and the reason of this dependency
- For the main packages, draw a class diagram with the main entities (classes, instance variables and methods)
- How does test packages depend on other packages?
47.3. High-Level Behavior
- Explain the different phases (and related classes) transforming a Pillar file into an HTML file.
- Pillar has tests for abstractions (i.e., abstract classes) such as
PRFormat. These tests must hold for each implementation of these abstractions (i.e., all subclasses). Explain how this works in practice.
- What is responsible for parsing the command-line arguments (e.g.,
) passed to the pillar command? How is the command-line interface implemented?
47.4. Studying Patterns
- Find at least one instance of these design patterns:
- template method
47.5. Visiting the Visitor
- Draw a sequence diagram explaining how the super calls work in visiting methods (e.g.,
- What is the role of the brush, canvas and writer classes in
- What is the role of a transformer? What are the different types of transformers?
47.6. Technical Details
- The methods in the
transformers protocol of some subclasses of
PRPhase are never called directly (i.e., there are no senders). When are they executed? What does the
<pillarTransformer:*> line at the beginning of each of these methods mean? Draw a sequence diagram.
- How does Pillar maps a language name (e.g.,
"bash") to a particular subclass of
- Pillar supports multiple ways of writing heading numbers (e.g., "See Section A.1.b"). Explain how the different numbering styles are implemented in Pillar and how they can be configured by the user.