File: abstract-factory.tex

package info (click to toggle)
texlive-base 2018.20190227-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 680,080 kB
  • sloc: perl: 39,836; sh: 6,386; makefile: 3,708; ruby: 2,412; ansic: 2,266; xml: 1,686; cpp: 695; awk: 606; python: 583; tcl: 541; lisp: 86; php: 65; sed: 8
file content (69 lines) | stat: -rw-r--r-- 1,927 bytes parent folder | download | duplicates (8)
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

\begin{tikzpicture}[show background grid]
  \begin{interface}{AbstractFactory}{0,0}
    \operation[0]{+ CreateProductA()}
    \operation[0]{+ CreateProductB()}
  \end{interface}

  \begin{class}{ConcreteFactory2}{-3,-4}
    \implement{AbstractFactory}
    \operation{+ CreateProductA()}
    \operation{+ CreateProductB()}
  \end{class}

  \begin{class}{ConcreteFactory1}{3,-4}
    \implement{AbstractFactory}
    \operation{+ CreateProductA()}
    \operation{+ CreateProductB()}
  \end{class}

  \begin{interface}{AbstractProductA}{15,-2}
  \end{interface}

  \begin{class}{ProductA1}{12,-5}
    \implement{AbstractProductA}
  \end{class}

  \begin{class}{ProductA2}{18,-5}
    \implement{AbstractProductA}
  \end{class}

  \draw[umlcd style dashed line,->] (ConcreteFactory1) --node[above,
  sloped, black]{$<<$instantiate$>>$} (ProductA1);

  \draw[umlcd style dashed line,->] (ConcreteFactory2.south) ++
  (1,0) -- ++(0,-1) -- node[above, sloped,
  black]{$<<$instantiate$>>$} ++(20,0) -| (ProductA2);

  \begin{interface}{AbstractProductB}{15,-8}
  \end{interface}

  \begin{class}{ProductB1}{12,-11}
    \implement{AbstractProductB}
  \end{class}

  \begin{class}{ProductB2}{18,-11}
    \implement{AbstractProductB}
  \end{class}

  \draw[umlcd style dashed line,->] (ConcreteFactory1) |-node[above,
  sloped, black]{$<<$instantiate$>>$} (ProductB1);

  \draw[umlcd style dashed line,->] (ConcreteFactory2.south) ++
  (-1,0) -- ++(0,-7) -- node[above, sloped,
  black]{$<<$instantiate$>>$} ++(20,0) -| (ProductB2);

  \begin{class}{Client}{22,-0.5}
  \end{class}

  \draw[umlcd style dashed line,->] (Client) --node[above, sloped,
  black]{$<<$import$>>$} (AbstractFactory);

  \draw[umlcd style dashed line,->] (Client) |-node[above, sloped,
  black]{$<<$import$>>$} (AbstractProductA);

  \draw[umlcd style dashed line,->] (Client) |-node[above, sloped,
  black]{$<<$import$>>$} (AbstractProductB);
\end{tikzpicture}