-
Notifications
You must be signed in to change notification settings - Fork 0
Design Patterns Assignment
adirzim edited this page May 28, 2011
·
3 revisions
In a town there is only one bank which manages accounts of citizens. Each account contains: * percent on deposit, * date when they were open * saving period ( 3, 7 or 10 years ).
There are 3 types of accounts:
- Account which is allowed to close any time after 2 years
- Account which can be managed by all family members ( family accounts )
- Account which deposit is allowed to invest in Stock Exchange
Write a program in which when the bank performs operation it will notify relevant account owners:
• The bank decides to invest money in Stock exchange but only for accounts which saving period is 10 years and were open not more than 5 years ago.
• Bank decides to give bonus of 500 shekels only to family accounts.
• Bank sends message to all 2 years saving account owners to come to the bank for the meeting with clerk.
- Program has to implement Singleton, Factory Method , Observer and Bridge Design Patterns. • Bank is both Singleton and Subject • Create an Abstract Base Class ( ABC ) Account and all specific Accounts have to derive from it. • Think, in which class has to be a Factory Method? • Separate Implementation from Design for Accounts ( Bridge )
- Testing program ( main ) has to be provided. Hard-coded input is forbidden
- Usage of STL is required (example: to hold in Subject the pointers to Observers. Pick STL container by yourself and write in comment why did you pick this specific container ).