programming languages Online Quiz - 184
|Description: programming languages Online Quiz - 184|
|Number of Questions: 20|
|Created by: Aliensbrain Bot|
|Tags: programming languages|
What is an aspect?
Struts framework follows
What scopes are available in struts?
Which of the following are the scopes defined in spring?
Hibernate is the best solutions for data centric applications that only uses the stored-procedures to implement the business logic in database.
MVC is a software approach that separates application logic from presentation
What is Service-oriented Architecture (SOA)?
Which of the following is considered to be guiding principles of SOA?
Which of the following is a feature of the “Web service”, as the building block of SOA?
A service provider is responsible for the business aspects of the published web service, such as pricing
A service provider creates and publishes Web services, together with their interface and access description
A service provider is also known as the “service registry”
Which of the following is a key concept of SOA?
Compact Computers is a small computer assembly company. Their online application allows customers to pick and choose accessories to build their own PCs. The accessories are: i. Processor - 800Mhz, 1Ghz, 1.2Ghz ii. HDD - 40 GB, 60 GB, 80 GB iii. Memory - 128 MB, 256 MB, 512 MB If a computer can have exactly 1 processor, 1 HDD and 1 memory stick, what pattern would be best used here?
Which of the following are true about the Bridge and Adapter patterns?
As part of your new application you need to create a custom class loader so that you can implement with custom security. So you need to create objects without knowing the class of the objects or how to create them. What pattern should you use for this?
You are creating a web application for an online product ordering system. You will be using data from several different databases and to reduce the load on the databases you have decided to use connection pooling. You have a ConnectionPool class and you want one pool for each database however you will have to connect to a variable number of databases. What pattern should you use?
You are designing an application to be used to edit photographs. The aim of the application is to provide effects such as converting a color picture to black and white, enlarging certain areas of the print, creating a watercolor effect etc. At the moment the application is structured so that the photographic image is represented by one object, other objects represent each effect and a control object is used to co-ordinate with these objects. When the user selects the color to black and white effect it changes the state of the Color object to Black and White. This then needs to co-ordinate with the control object and apply the effect. Basically as the state of the effects objects changes it need to co-ordinate with the photographic image object.Which design pattern do you use?
You are a Computer Science lecturer at a top University. You are giving a presentation of a new piece of software you have written. Basically you have written the next generation spell checker, the reason yours is so good is that it can learn the common typing mistakes of an individual user. You have already sold licenses to many major software vendors and plan to retire in the Sun. However before you go they all require slight changes in the logic to suit their individual needs. What design pattern will help you slightly change the logic in a class to be used in many applications?
When would you use the Visitor pattern?
To answer this question, you need to understand the Visitor pattern and its purpose.
The Visitor pattern is a behavioral design pattern that allows you to define new operations on a set of classes without changing the classes themselves. It separates the algorithm from the objects it operates on.
Let's go through each option to understand why it is correct or incorrect:
Option A) You need two unconnected objects to be able to send messages to each other. This option is incorrect. The Visitor pattern does not facilitate communication between two unconnected objects. It is primarily used to add new operations to a set of classes without modifying those classes directly.
Option B) You need two connected objects to be able to send messages to each other. This option is incorrect. The Visitor pattern does not facilitate direct communication between connected objects. It is used to add new operations to a set of classes without modifying those classes directly.
Option C) You need to create a new operation on an object and you will change the classes of elements on which it operates. This option is incorrect. The Visitor pattern is specifically designed to avoid changing the classes of elements on which the new operation operates. It allows you to add new operations without modifying the existing classes.
Option D) You need to create a new operation on an object without changing the classes of elements on which it operates. This option is correct. The Visitor pattern is commonly used in situations where you want to add new operations to a set of classes without modifying the classes themselves. It allows you to define a separate visitor class that contains the new operation, which can then be applied to objects of the existing classes.
The correct answer is D. This option is correct because it accurately describes a common use case for the Visitor pattern.