% -*- mode: latex; -*- mustache tags:  
\ifx\wholebook\relax\else

	\documentclass[10pt,twoside,english]{root/support/latex/sbabook/sbabook}
  \usepackage{import}
  \subimport{root/support/latex/}{common.tex}

  \hypersetup{pdfinfo = {
    Title = {{Pharo Mooc}},
    Author = {},
    Keywords = {pharo, smalltalk}}}
  \begin{document}
\fi

\chapter{Understanding Existing Code}
In this exercise session, you will practice how to approach a system and understand it. 
\section{Setup}
Download Pharo with Pillar from the Pillar website on Smalltalkhub \url{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).
\section{High-Level Structure}
\begin{enumerate}
\item Draw a package diagram explaining which package depends on which one and the reason of this dependency
\item For the main packages, draw a class diagram with the main entities (classes, instance variables and methods)
\item How does test packages depend on other packages?
\end{enumerate}
\section{High-Level Behavior}
\begin{enumerate}
\item Explain the different phases (and related classes) transforming a Pillar file into an HTML file.
\item Pillar has tests for abstractions (\textit{i.e.}, abstract classes) such as \textcode{PRList} and \textcode{PRFormat}. These tests must hold for each implementation of these abstractions (\textit{i.e.}, all subclasses). Explain how this works in practice.
\item What is responsible for parsing the command-line arguments (\textit{e.g.}, \textcode{\sout{baseDirectory\textcode{ and }}to}) passed to the pillar command? How is the command-line interface implemented?
\end{enumerate}
\section{Studying Patterns}
\begin{enumerate}
\item Find at least one instance of these design patterns:
\begin{enumerate}
\item template method
\item visitor
\item composite
\item interpreter
\end{enumerate}

\end{enumerate}
\section{Visiting the Visitor}
\begin{enumerate}
\item Draw a sequence diagram explaining how the super calls work in visiting methods (\textit{e.g.}, \textcode{visitBoldFormat:} of \textcode{PRHTMLWriter}).
\item What is the role of the brush, canvas and writer classes in \textcode{Pillar-ExporterCore}?
\item What is the role of a transformer? What are the different types of transformers?
\end{enumerate}
\section{Technical Details}
\begin{enumerate}
\item The methods in the \textcode{transformers} protocol of some subclasses of \textcode{PRPhase} are never called directly (\textit{i.e.}, there are no \textit{senders}). When are they executed? What does the \textcode{\textless{}pillarTransformer:*\textgreater{}} line at the beginning of each of these methods mean? Draw a sequence diagram.
\item How does Pillar maps a language name (\textit{e.g.}, \textcode{\symbol{34}smalltalk\symbol{34}} and \textcode{\symbol{34}bash\symbol{34}}) to a particular subclass of \textcode{PRAbstractScriptLanguage}?
\item Pillar supports multiple ways of writing heading numbers (\textit{e.g.}, \symbol{34}See Section A.1.b\symbol{34}). Explain how the different numbering styles are implemented in Pillar and how they can be configured by the user.
\end{enumerate}


\ifx\wholebook\relax\else
\end{document}
\fi