Quiz
Unit 9 Architecture, patterns and reuse (Part 2)
This quiz has question types that open in the usual player.
Questions in this quiz (15)
1The Model-View-Controller's classic use is in the design of applications that have [blank_start]graphical user interfaces[blank_end].
- Agraphical user interfaces
2Insert the components in the correct box.

- AModel
- BView
- CController
- DModel
- EView
- FController
- GController
- HModel
- IView
3[blank_start]Splits[blank_end] user interface interaction into three distinct roles: the [blank_start]model[blank_end] of the domain, the [blank_start]view[blank_end] representing that domain, and the [blank_start]controller[blank_end] of changes to the domain.
- ASplits
- Bmodel
- Cview
- Dcontroller
4Name the components of the architecture style this chart software uses.

- AController
- BView
- CModel
5Complete the missing labels.

- ASubject
- Bobserver
6Fill in the labels with correct Interface and concrete class name.

- Aobserver
- BConcreteObserver
7What is the purpose of the Singleton pattern?
- AIn many cases only a single instance of a class is required and
allowing creation of more than one instance would compromise the design of the system. - BAllows a client to use a class that has a different interface from
the one the client is expecting. - CSplits user interface interaction into three distinct roles: the model of the domain, the view representing that domain, and the controller of changes to the domain.
- DWhen partitioning a system into individual classes you want the
coupling between them to be loose so you have the flexibility to vary them independently. But a mechanism is needed to ensure that when the state of an object changes related objects are updated to keep hem in step.
- AIn many cases only a single instance of a class is required and
8The figure illustrates the application of the singleton pattern to the design of a media manager in a multimedia application. There should be only one instance of the manager, which is created by the MediaManager class itself the first time a client accesses the manager.
This strategy of creation on demand is called [blank_start]lazy[blank_end] instantiation.
- Alazy
9Fill in the 2 blanks in note rectangle.

- Aonly
- Bunique
10Select all statements that apply to the Singleton Pattern. Select 3.

- AThe Singleton class provides no public operation for creating
instances. - BThe Singleton class defines a public operation getInstance() that
lets clients access the unique instance of the class. - CThe Singleton class is responsible for creating its own unique instance and no other class should be able to create an instance, so the create() operation is private
- DThe Singleton class lets the program call a create() method and create new instances.
- EThe Singleton instance is not publicly accessible.
- AThe Singleton class provides no public operation for creating
11A factory is a specialised object for [blank_start]creating[blank_end] and [blank_start]initialising[blank_end] objects needed by clients. The object the factory produces is called the [blank_start]product[blank_end]
- Acreating
- Binitialising
- Cproduct
12What is the purpose of the Factory Pattern?

- AIf the creation and initialisation of an object is complex and liable to change, making clients responsible for the task introduces an undesirable level of coupling.
- BEncapsulating the creation in a dedicated factory class hides the details from the client and reduces the coupling
- CEncapsulating the implementation in a dedicated factory class hides the details from the client and reduces the coupling
13A factory [blank_start]Method[blank_end] Pattern is used where a client requires a factory for a product without knowing the actual [blank_start]class[blank_end] of the product; only its interface.
- AMethod
- Bclass
14Which of the following statements are true about the factory method pattern?

- AThe client is not aware of the actual class of the factory
- BThe client does not know the interface of the factory
- CThe client only interacts with the factory via its interface
- DThe actual class for the interface is decided at run time in some way (ex: config file, system setting).
- EThe actual class for the interface is decided when the client class gets initiated.
15The above figure shows examples of:

- ASingleton Pattern
- BFactory Method Pattern
- CObserver Pattern
- DCall-return Style
Information
- Description
- Unit 9, from section 5.3 to end
- Author
- Frans k
- Language
- English
- Views
- 9
- Tags
- Rating
- No ratings yet Rate this quiz