docs/DesignPatterns

changeset 8:c9e5dcd79aae

rename; cleanups
author meillo@marmaro.de
date Mon, 18 Jun 2007 12:38:48 +0200
parents 20c0116dcb97
children d7c3983a367a
files code/composite-component.java code/composite-composite.java composite.tex
diffstat 3 files changed, 38 insertions(+), 48 deletions(-) [+]
line diff
     1.1 --- a/code/composite-component.java	Mon Jun 18 12:10:45 2007 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,34 +0,0 @@
     1.4 -    class Composite implements IComponent {
     1.5 -            private String id;
     1.6 -            private List<IComponent> list = new ArrayList<IComponent> ();
     1.7 -
     1.8 -            public Composite(String id) {
     1.9 -                    this.id = id;
    1.10 -            }
    1.11 -
    1.12 -            public String toString() {
    1.13 -                    StringBuilder buf = new StringBuilder();
    1.14 -                    buf.append(String.format("(%s:", id));
    1.15 -
    1.16 -                    for (IComponent child : list) {
    1.17 -                          buf.append(" " + child.toString());
    1.18 -                    }
    1.19 -                    buf.append(")");
    1.20 -
    1.21 -                    return buf.toString();
    1.22 -            }
    1.23 -
    1.24 -            //public List<IComponent> getChildren()
    1.25 -
    1.26 -            public Collection getChildren(){
    1.27 -                    return list;
    1.28 -            }
    1.29 -
    1.30 -            public boolean addComponent(IComponent c){
    1.31 -                    return list.add(c);
    1.32 -            }
    1.33 -
    1.34 -            public boolean removeComponent(IComponent c){
    1.35 -                    return list.remove(c);
    1.36 -            }
    1.37 -    }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/code/composite-composite.java	Mon Jun 18 12:38:48 2007 +0200
     2.3 @@ -0,0 +1,34 @@
     2.4 +    class Composite implements IComponent {
     2.5 +            private String id;
     2.6 +            private List<IComponent> list = new ArrayList<IComponent> ();
     2.7 +
     2.8 +            public Composite(String id) {
     2.9 +                    this.id = id;
    2.10 +            }
    2.11 +
    2.12 +            public String toString() {
    2.13 +                    StringBuilder buf = new StringBuilder();
    2.14 +                    buf.append(String.format("(%s:", id));
    2.15 +
    2.16 +                    for (IComponent child : list) {
    2.17 +                          buf.append(" " + child.toString());
    2.18 +                    }
    2.19 +                    buf.append(")");
    2.20 +
    2.21 +                    return buf.toString();
    2.22 +            }
    2.23 +
    2.24 +            //public List<IComponent> getChildren()
    2.25 +
    2.26 +            public Collection getChildren(){
    2.27 +                    return list;
    2.28 +            }
    2.29 +
    2.30 +            public boolean addComponent(IComponent c){
    2.31 +                    return list.add(c);
    2.32 +            }
    2.33 +
    2.34 +            public boolean removeComponent(IComponent c){
    2.35 +                    return list.remove(c);
    2.36 +            }
    2.37 +    }
     3.1 --- a/composite.tex	Mon Jun 18 12:10:45 2007 +0200
     3.2 +++ b/composite.tex	Mon Jun 18 12:38:48 2007 +0200
     3.3 @@ -36,10 +36,7 @@
     3.4  
     3.5  
     3.6  \section[Outline]{}
     3.7 -\frame{
     3.8 -  Dauer der Präsentation: etwa 10 Minuten
     3.9 -  \vspace{2ex}
    3.10 -
    3.11 +\frame{ \frametitle{Outline}
    3.12    \tableofcontents
    3.13  }
    3.14  
    3.15 @@ -87,6 +84,7 @@
    3.16  
    3.17  
    3.18  \section{Java-Beispiel}
    3.19 +\subsection{main, IComponent}
    3.20  \frame{ \frametitle{class Main, interface IComponent}
    3.21  
    3.22    {\tiny
    3.23 @@ -97,6 +95,7 @@
    3.24  }
    3.25  
    3.26  
    3.27 +\subsection{Composite}
    3.28  \frame{ \frametitle{class Composite}
    3.29  
    3.30    {\tiny
    3.31 @@ -106,6 +105,7 @@
    3.32  }
    3.33  
    3.34  
    3.35 +\subsection{Leaf}
    3.36  \frame{ \frametitle{class Leaf}
    3.37  
    3.38    {\tiny
    3.39 @@ -126,16 +126,6 @@
    3.40      \item 
    3.41    \end{itemize}
    3.42    \end{block}
    3.43 -
    3.44 -  \pause
    3.45 -
    3.46 -  \begin{block}{Fazit}
    3.47 -    \begin{itemize}
    3.48 -      \item 
    3.49 -      \item 
    3.50 -      \item 
    3.51 -    \end{itemize}
    3.52 -  \end{block}
    3.53  }
    3.54  
    3.55