关键词 > SOFT2201/COMP9201

SOFT2201/COMP9201 Week 12 Tutorial

发布时间:2023-02-11

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

SOFT2201/COMP9201

Week 12 Tutorial

Singleton & Decorator & Façade

Question 1: Singleton Pattern

Singleton is one of the easiest patterns to implement once you know it, but is one of the easiest to use poorly - it effectively creates a ’fancy’global variable(s). Consider our pool game scenario, what opportunities might exist for the use of the singleton pattern?  Model the possible use of singleton pattern in pool game scenario in a UML class diagram, and try to determine what the actual positive and negative consequences of the pattern are in this context. If you are sure that there is no possibility to use this design pattern in the pool game scenario, please identify the reason. Discuss your answer with your tutor during tutorial. Please note that, we are trying to discuss any possibility to use this

design pattern under the given scenario. Therefore, you don’t need to be restricted by the existing requirements of the assignments.

Question 2: Decorator Pattern

Consider our pool game scenario, see if you can come up with your own decorator.  For example, this could be a double points reward, etc.  Model the possible use of decorator pattern in the pool game scenario in a UML class diagram, and try to determine what the actual positive and negative consequences of the pattern are in this context. If you are sure that there is no possibility to use this design pattern in the pool game scenario, please identify the reason. Discuss your answer with your tutor during tutorial. Please note that, we are trying to discuss any possibility to use this design pattern under the given scenario. Therefore, you don’t need to be restricted by the existing requirements of the assignments.

Question 3: Façade Pattern

Façade is an easy pattern to implement. It is required not so much for low-scale design but modular architectural design. There might be a place for it in our pool game scenario - some of you naturally gravitated towards it due to the need for encapsulation and proper separation of concerns. See if you can identify any possible use of the façade pattern in the pool game scenario. Model the possible use of this pattern in a UML class diagram, and try to determine what the actual positive and negative consequences of the pattern are in this context. If you are sure that there is no possibility to use this design pattern in the pool game scenario, please identify the reason. Discuss your answer with your tutor during tutorial. Please note that, we are trying to discuss any possibility to use this design pattern under the given scenario. Therefore, you don’t need to be restricted by the existing requirements of the assignments.

Question 4: Open Discussion on Weekly Exercises and Assignment

An open discussion on weekly exercises 7, 8, 9, and assignment 2 will be held under the guide of your tutor in an interactive way.  Tutors are going to summarise their feedback and observations during their marking process of weekly exercises and assignment 2, and to address the common problems via discussions.