-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmvc.tex
129 lines (93 loc) · 3.38 KB
/
mvc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
% $Id$
%
\section{Arquitectura modelo-vista-controlador}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{¿Qué es la arquitectura MVC?}
\begin{itemize}
\item Patrón de arquitectura (implementación)
\item Desacopla tres elementos:
\begin{itemize}
\item datos (estado de la aplicación)
\item representación en la interfaz
\item lógica de aplicación
\end{itemize}
\item Modelo: datos (estado) y su gestión
\item Vista: Representación en la interfaz (filtrado, actualización de datos)
\item Controlador: lógica de la aplicación y flujo de información
\end{itemize}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{MVC en aplicaciones web (1)}
\begin{quotation}
The model is any of the logic or the database or any of the data itself. The view is simply how you lay the data out, how it is displayed. [...]
The controller in a web app is a bit more complicated, because it has two parts. The first part is the web server (such as a servlet container) that maps incoming HTTP URL requests to a particular handler for that request. The second part is those handlers themselves, which are in fact often called ``controllers''.[...]
\end{quotation}
\begin{flushright}
``The Importance of Model-View Separation'', Terence Parr \\
\end{flushright}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{MVC en aplicaciones web}
{\Large
\begin{itemize}
\item Modelo: \\ Descripción y gestion de base de datos
\item Vista: \\ Interfaz de usuario (HTML) \\
que presenta el modelo al usuario
\item Controlador: \\ Recibe indicaciones del usuario, \\
indica cambios al modelo, \\
elige vista para mostrar resultados
\end{itemize}
}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{MVC en applicaciones web}
\begin{center}
\includegraphics[width=0.8\textwidth]{figs/mvc-basic}
\end{center}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{MVC en Django}
\begin{itemize}
\item Vista: Manejadores (lógica de aplicación) \\
funciones en views.py
\item Vistas delegan la presentación en plantillas (templates)
\item Modelo: Descripción de los datos \\
clases en models.py
\item Controlador: maquinaria de Django \\
incluyendo urls.py
\item Django como ``plataforma MTV'': \\
modelo, plantilla (template), vista
\end{itemize}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{Django: MTV}
\begin{center}
\includegraphics[width=0.8\textwidth]{figs/mvc-mtv}
\end{center}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}
%\frametitle{Django: MTV}
\begin{center}
\includegraphics[width=0.85\textwidth]{figs/mvc-mtv-django}
\end{center}
{\footnotesize
Fuente: \url{http://archive.cloudera.com/cdh4/cdh/4/hue/sdk/sdk.html}
}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{Referencias}
\begin{itemize}
\item MVC, Xerox PARC 1978-79: \\
\url{http://heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html}
\item ``The Importance of Model-View Separation. A Conversation with Terence Parr'', by Bill Venners \\
\url{http://www.artima.com/lejava/articles/stringtemplate.html}
\end{itemize}
\end{frame}