Fundamental Design Patterns Practice
|Delegation||Design an ATM system for banks A, B, C, D in the USA to use.|
-The ATMs of all banks provide withdraw, deposit, and transfer capabilities
-The ATMs of banks A and B have stock purchasing capability
-The ATMs of banks B and C provide online pay capability
-The ATMs of banks A, C and D are 24/7
What pattern would be used?
|Marker Interface, Immutable||Model a cub scout system with four dens: lion tiger, wolf and bear. The wolf and bear are more senior scouts than the other two. Award A can be given to lions and tigers. Award B can be given to tigers and wolfs. Award C is given to wolfs and bears. Award D is given to tigers, wolfs and bears.|
For each scout, there are attributes such as name, age, sex and height. However, only age and height are allowed to be changed in the system.
What patterns can be used?
|Proxy||A system provided a service for use, and its computation took time. To prevent users from getting bored, a plan is to first show a greeting message and the waiting time before performing the service. After service is done, a "thank you" prompt will be displayed. Which design pattern would be used?|