diff options
Diffstat (limited to 'bank-eiffel/bank_store.e')
| -rw-r--r-- | bank-eiffel/bank_store.e | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/bank-eiffel/bank_store.e b/bank-eiffel/bank_store.e new file mode 100644 index 0000000..acc6f3a --- /dev/null +++ b/bank-eiffel/bank_store.e | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | class | ||
| 2 | BANK_STORE | ||
| 3 | |||
| 4 | inherit | ||
| 5 | STORABLE | ||
| 6 | |||
| 7 | create | ||
| 8 | make | ||
| 9 | |||
| 10 | feature | ||
| 11 | |||
| 12 | persons: ARRAYED_SET [PERSON] | ||
| 13 | |||
| 14 | accounts: ARRAYED_SET [ACCOUNT] | ||
| 15 | |||
| 16 | ranges: TUPLE [ | ||
| 17 | account: attached like account_range; | ||
| 18 | studentaccount: attached like account_range; | ||
| 19 | retireeaccount: attached like account_range | ||
| 20 | ] | ||
| 21 | |||
| 22 | feature {NONE} -- Implementation | ||
| 23 | |||
| 24 | account_range: detachable TUPLE [ | ||
| 25 | creditline: attached like range; | ||
| 26 | interest_deposit: attached like range; | ||
| 27 | interest_debit: attached like range | ||
| 28 | ] | ||
| 29 | |||
| 30 | range: detachable like {ACCOUNT}.range | ||
| 31 | |||
| 32 | feature {NONE} -- Initialization | ||
| 33 | |||
| 34 | make(cap: INTEGER) | ||
| 35 | do | ||
| 36 | create persons.make(cap) | ||
| 37 | create accounts.make(cap) | ||
| 38 | create ranges | ||
| 39 | ranges.account := new_range | ||
| 40 | ranges.studentaccount := new_range | ||
| 41 | ranges.retireeaccount := new_range | ||
| 42 | end | ||
| 43 | |||
| 44 | new_range: attached like account_range | ||
| 45 | do | ||
| 46 | create Result | ||
| 47 | end | ||
| 48 | end | ||
