diff --git a/latex/code/patterns/structural/adapter.py b/latex/code/patterns/structural/adapter.py index c1fbacb..3d88189 100644 --- a/latex/code/patterns/structural/adapter.py +++ b/latex/code/patterns/structural/adapter.py @@ -15,11 +15,11 @@ def training(...) # <-- this method should be called train class ModelAdapter(OurMLModel): # <-- implements our interface def __init__(self, model: TheirMLModel): self._model = model # <-- our adapter holds the foreign model - + def train(...): # <-- and defines a different interface for it self._model.training(...) # Their model with our interface: -model = ModelAdapter(TheirMLModel(...)) +model = ModelAdapter(TheirMLModel(...)) # (actually need TheirConcreteMLModel) diff --git a/latex/input/patterns/careful.tex b/latex/input/patterns/careful.tex index b37d43c..0ebf116 100644 --- a/latex/input/patterns/careful.tex +++ b/latex/input/patterns/careful.tex @@ -10,12 +10,12 @@ \section{Discussion} \end{quote} } \begin{itemize}[<+->] - \item \hhl{Example}: If functions are first-level objects \srem{(can be passed around like normal datatypes)}, I do not need to define a strategy class hierarchy. \\ + \item \hhl{Example}: If functions are first-level objects \srem{(can be passed around like normal datatypes)}, I do not \srem{(always)} need to define a strategy class hierarchy. \\ However, this could still be considered the same \enquote{pattern} \srem{(only with a simpler implementation)} \item The \enquote{Patterns} give you \hhl{vocabulary} to describe your problem in an abstract way, even if the implementation details very a lot between languages \item Lots of pattern boilerplate should make you think about your design and language choices - \item Be aware that the implementation of \srem{(or even the need for)} certain patterns can be very dependent on your language features - \end{itemize} + \item Be aware that the implementation of \srem{(or even the need for)} certain patterns can be very dependent on your language features + \end{itemize} \end{frame} \begin{frame}{Common criticism} @@ -27,12 +27,12 @@ \section{Discussion} % \begin{itemize}[<+->] % - \item + \item Remember the zen of python: simple is better than complex; but complex is better than complicated % \item - Do not introduce complexity \srem{(use the design pattern)} if you do not fully understand why you need it. - \item + Do not introduce complexity \srem{(use the design pattern)} if you do not fully understand why you need it. + \item Some people highlight the KISS \srem{(\underline keep \underline it \underline simple, \underline stupid)} and YAGNI \srem{(\underline you \underline aren't \underline gonna \underline need \underline it)} principle \end{itemize} \end{frame} diff --git a/timing.ods b/timing.ods index ad4b6ce..e443fee 100644 Binary files a/timing.ods and b/timing.ods differ