\begin{frame}[fragile] \frametitle{Object Relational Mapping} \begin{goal}{Object Relational Mapping} Maps rows in tables to objects: \begin{itemize} \item table $\approx$ class \item row $\approx$ object \item foreign key navigation $\approx$ pointers / references \end{itemize} \end{goal} \bigskip \begin{tcenter} \scalebox{.8}{ \begin{tikzpicture} \umlclass{Event}{ +name \\ +date }{ } \umlclass[x=3.4]{Venue}{ +name }{ } \umlassoc[arg1=0..*,pos1=0.3,arg2=1,pos2=.8,name=assoc]{Event}{Venue} \node [align=left,fill=blue!10,rectangle,rounded corners=1mm,dashed,draw,inner sep=2mm] at (-6.5,0) { \small\texttt{public class Event \{}\\ \small\texttt{\ \ String getName();}\\ \small\texttt{\ \ String getDate();}\\ \small\texttt{\ \ Venue getVenue();}\\ \small\texttt{\}} }; \node [align=center,draw,fill=red!10] (m) at (-2.8,0cm) {mapping}; \draw [ultra thick,red,->,>=triangle 45] (m) -- +(1.7cm,0cm); \draw [ultra thick,red,->,>=triangle 45] (m) -- +(-1.7cm,0cm); \end{tikzpicture} } \end{tcenter} \pause\smallskip \begin{goal}{Ingredients} \begin{itemize} \item mapping from objects to database (automatic or designed) \item run-time library handles interaction with the database \end{itemize} \end{goal} Many ORM toolkits: Hybernate, RubyOnRails, ADO.NET,\ldots \end{frame}