summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pgf-umlcd/demo/inheritance.tex
blob: 3399f606a412de2811c5eb73c07e90c5c1868ddd (plain)
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
\begin{tikzpicture}
  \begin{class}[text width=5cm]{BankAccount}{0,0}
    \attribute{owner : String}
    \attribute{balance : Dollars = 0}

    \operation{deposit(amount : Dollars)}
    \operation[0]{withdrawl(amount : Dollars)}
  \end{class}

  \begin{class}[text width=7cm]{CheckingAccount}{-5,-5}
    \inherit{BankAccount}
    \attribute{insufficientFundsFee : Dollars}

    \operation{processCheck ( checkToProcess : Check )}
    \operation{withdrawal ( amount : Dollars )}
  \end{class}

  \begin{class}[text width=7cm]{SavingsAccount}{5,-5}
    \inherit{BankAccount}
    \attribute{annualInteresRate : Percentage}

    \operation{depositMonthlyInterest ( )}
    \operation{withdrawal ( amount : Dollars )}
  \end{class}

\end{tikzpicture}