

% add the PATH to retrieve cls and sty beamer styles files
\makeatletter
\providecommand*{\input@path}{}
\edef\input@path{{../../support/beamer/}\input@path}% prepend
\makeatother

% \documentclass{pharoslides}
% \documentclass[aspectratio=169]{pharoslides} % format 16/9
\documentclass[withvideo]{pharoslides} % format 16/9 + incrustation video

\graphicspath{{./figures/}{../}{../../support/beamer/imgs/}}

%Information to be included in the title page:
\title{Inheritance and Lookup}
\subtitle{5: Lookup in metaclasses}
\author{Damien Cassou, Stéphane Ducasse and Luc Fabresse}
\institute{http://stephane.ducasse.free.fr}
\date{}
\slidesid{W4S05}

\begin{document}

\frame[plain]{\titlepage}



\begin{frame}[fragile]

\frametitle{Goal}

\begin{enumerate}
\item in Pharo, everything is an object
\item objects can receive messages
\item classes are objects too
\end{enumerate}

Classes can receive messages. The mechanism is \textbf{exactly} the same
\end{frame}



\begin{frame}[fragile]

\frametitle{Only One Lookup Rule}

\begin{columns}

\begin{column}{0.4\textwidth}

The lookup starts in the \textbf{class} of the \textbf{receiver} then:

\begin{itemize}
\item if the method is defined in the class, it is returned
\item otherwise the search continues in the superclass
\end{itemize}
\end{column}


\begin{column}{0.5\textwidth}


\begin{center}
\includegraphics[width=1.0\textwidth]{figures/LookupEssenceWithDoesNotUnderstand.png}\end{center}

\end{column}

\end{columns}

\end{frame}



\begin{frame}[fragile]

\frametitle{A Class is an Instance of Another Class}

Class \code{X} is always the unique instance of the class \code{X class}:

\begin{itemize}
\item \code{Node} is a class and an object
\item each object is an instance of a class
\item the class of \code{Node} is \code{Node class}
\item the class \code{Node class} is automatically created
\end{itemize}


\begin{center}
\includegraphics[width=1.0\textwidth]{figures/ClassMetaclass.png}\end{center}

\end{frame}



\begin{frame}[fragile]

\frametitle{Superclass Chain}


\begin{center}
\includegraphics[width=1.2\textwidth]{figures/WorkstationMetaclassesWithInheritance.png}\end{center}

\end{frame}



\begin{frame}[fragile]

\frametitle{Lookup of Class Methods is No Different}


\begin{center}
\includegraphics[width=1.4\textwidth]{figures/WorkstationMetaclassesWithInheritanceWithLookup.png}\end{center}

\end{frame}



\begin{frame}[fragile]

\frametitle{What You Should Know}

\begin{itemize}
\item A class is an object
\item A class can receive messages
\item Method lookup is exactly the same as for all objects:
\begin{itemize}
\item go to the class of the receiver 
\item follow inheritance chain
\end{itemize}

\item More during the lecture \textit{Understanding Metaclasses}
\end{itemize}
\end{frame}




% \setlength{\textwidth}{\originaltextwidth}
\setbeamertemplate{background canvas}{\insertBorderForHandout}

\begin{frame}[plain]

\begin{minipage}{\originaltextwidth}
\centering
\large


\vspace{2em}

A course by

\vspace{1em}

\hspace{-20px}\includegraphics[height=32px]{inriaLogo}\hspace{3em}\raisebox{7px}{and}\hspace{3em}\raisebox{-6px}{\includegraphics[height=30px]{logoutop}}

\vspace{2em}

in collaboration with

\vspace{1em}

\includegraphics[height=40px]{unisciellogo}\hskip 1.5em%
\raisebox{5px}{\includegraphics[height=30px]{unitlogo}}\hskip 2em%
\raisebox{8px}{\includegraphics[height=24px]{univLilleLogo}}\hskip 2em%
\raisebox{3px}{\includegraphics[height=29px]{logo-IMT}}\hskip 2em%
\raisebox{1px}{\includegraphics[height=32px]{minesDouaiLogo}}

\vspace{2.5em}

\includegraphics[width=50px]{by-nc-nd} \tiny \hskip 0.5em \raisebox{5px}{Inria 2016}

\medskip

\tiny
Except where otherwise noted, this work is licensed under CC BY-NC-ND 3.0 France

\url{https://creativecommons.org/licenses/by-nc-nd/3.0/fr/} 

\end{minipage}
\end{frame}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
