1.
____ methods retrieve and update attribute values.
Correct Answer
B. B. Get and set
Explanation
Get and set methods are used to retrieve and update attribute values in object-oriented programming. The get method is used to retrieve the value of an attribute, while the set method is used to update or modify the value of an attribute. These methods provide a way to access and manipulate the attributes of an object, ensuring encapsulation and data integrity. By using get and set methods, the attributes of an object can be accessed and modified in a controlled and consistent manner.
2.
The prototype pattern is a ____ pattern.
Correct Answer
B. b. creational object-level
Explanation
The prototype pattern is a creational object-level pattern. This pattern involves creating objects by cloning or copying existing objects, rather than creating new objects from scratch. It allows for the creation of new objects with different initial values or configurations, while avoiding the overhead of creating new objects from scratch.
3.
Which of the following is a responsibility of a view layer class?
Correct Answer
A. a. Display electronic forms and reports.
Explanation
The responsibility of a view layer class is to display electronic forms and reports. This means that the view layer class is responsible for presenting the user interface to the user, allowing them to interact with the application and view the necessary information in the form of electronic forms and reports. This responsibility does not involve establishing and maintaining connections to the database, preparing persistent classes for storage, or processing business rules with appropriate logic.
4.
In a communication diagram, a(n) ____ always directly follows the sequence number.
Correct Answer
C. Colon
Explanation
In a communication diagram, a colon always directly follows the sequence number. This is because the colon is used to separate the sequence number from the message or action being performed by the object in the diagram. It helps to clearly indicate the order of communication between objects and ensures that the diagram is easily understandable.
5.
Communication diagrams and sequence diagrams are both ____ diagrams, and they capture ____ information.
Correct Answer
A. a. interaction, the same
Explanation
Communication diagrams and sequence diagrams are both interaction diagrams, as they both depict the interactions between objects in a system. They capture the same information, which includes the messages exchanged between objects and the order in which these messages occur.
6.
The ____ pattern is a behavioral object-level pattern.
Correct Answer
D. Strategy
Explanation
The strategy pattern is a behavioral object-level pattern that allows different algorithms or strategies to be selected at runtime. It defines a family of algorithms, encapsulates each one, and makes them interchangeable. This pattern promotes loose coupling between the client and the algorithms, as the client can switch between strategies without modifying its code.
7.
Which of the following is a responsibility of a data access layer class?
Correct Answer
C. c. Disconnect gracefully from the database.
Explanation
A data access layer class is responsible for managing the connection between the application and the database. It is responsible for establishing a connection to the database, executing queries or commands to retrieve or update data, and closing the connection when it is no longer needed. Disconnecting gracefully from the database ensures that any resources are released properly and any pending transactions are committed or rolled back. This helps to maintain the integrity and efficiency of the database operations.
8.
In a communication diagram, true/false conditions are contained in ____.
Correct Answer
D. Brackets
Explanation
In a communication diagram, true/false conditions are contained in brackets. Brackets are commonly used to enclose conditions or expressions in programming languages, and in the context of a communication diagram, they serve the same purpose. They help to clearly define and represent the conditions or expressions being communicated between different elements or actors in the diagram.
9.
Design patterns became a widely accepted object-oriented design technique in 1996 when the ____ published Elements of Reusable Object-Oriented Software.
Correct Answer
D. d. Gang of Four
Explanation
In 1996, the book "Elements of Reusable Object-Oriented Software" was published, which introduced design patterns as a widely accepted object-oriented design technique. This book was written by a group of four authors, Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, who are commonly referred to as the Gang of Four (GoF). Therefore, the correct answer is d. Gang of Four.
10.
____ is a design principle to segregate classes into separate components based on the primary focus of the classes.
Correct Answer
B. b. Separation of responsibilities
Explanation
Separation of responsibilities is a design principle that involves dividing classes into separate components based on their primary focus. This helps to ensure that each class is responsible for a specific task or functionality, making the code more modular and easier to understand and maintain. This principle promotes better organization and reduces the complexity of the system by avoiding classes that have multiple responsibilities.
11.
A(n) ____ diagram in UML is simply a high-level diagram that allows designers to associate classes of related groups.
Correct Answer
B. Package
Explanation
A package diagram in UML is a high-level diagram that allows designers to associate classes of related groups. It is used to organize and structure the elements of a system, such as classes, interfaces, and other packages. The diagram visually represents the relationships and dependencies between these elements, making it easier to understand and manage the system's architecture.
12.
Over the last few years, powerful ____ (IDE) tools have been developed to help programmers construct systems.
Correct Answer
D. d. integrated development environment
Explanation
Over the last few years, powerful integrated development environment (IDE) tools have been developed to help programmers construct systems. An IDE is a software application that provides comprehensive facilities to computer programmers for software development. It typically consists of a source code editor, build automation tools, and a debugger. IDEs make it easier for programmers to write, test, and debug code by providing a unified interface and a set of integrated tools. Therefore, option d, integrated development environment, is the correct answer.
13.
Which of the following is a responsibility of a domain layer class?
Correct Answer
D. d. Process all business rules with appropriate logic.
Explanation
The responsibility of a domain layer class is to process all business rules with appropriate logic. This means that the domain layer class is responsible for implementing the specific rules and logic that govern the behavior and operations of the business domain it represents. This includes enforcing constraints, validating data, and performing any necessary calculations or transformations. The other options listed (displaying electronic forms and reports, establishing and maintaining connections to the database, and capturing input events) are typically responsibilities of other layers or components within an application architecture.
14.
The singleton pattern has the same basic logic as the ____ method pattern.
Correct Answer
B. Factory
Explanation
The singleton pattern has the same basic logic as the factory method pattern. Both patterns involve creating objects, but the singleton pattern ensures that only one instance of a class is created and provides a global point of access to it, while the factory method pattern delegates the responsibility of creating objects to subclasses.
15.
Developing ____ diagrams is at the heart of object-oriented detailed design.
Correct Answer
B. Interaction
Explanation
In object-oriented detailed design, the development of interaction diagrams is crucial. These diagrams depict how objects interact with each other to accomplish a specific task or functionality. They illustrate the flow of messages and communication between objects, helping to visualize the dynamic behavior of the system. By creating interaction diagrams, designers can effectively plan and organize the interactions between objects, ensuring the smooth functioning of the system.
16.
A(n) ____ frame is similar to an if-then-else statement or switch statement, which allows the firing of different sets of messages.
Correct Answer
C. Alt
Explanation
An "Alt" frame is similar to an if-then-else statement or switch statement, which allows the firing of different sets of messages. This means that based on certain conditions, different sets of messages can be executed.
17.
____ is the process of elaborating the detailed design with interaction diagrams of a particular use case.
Correct Answer
A. a. Use case realization
Explanation
Use case realization is the process of elaborating the detailed design with interaction diagrams of a particular use case. This involves identifying the classes, objects, and their interactions that are necessary to implement the use case. It helps in understanding how the use case will be implemented in the system and ensures that the design aligns with the requirements and goals of the use case. Use case realization is an important step in the software development process as it helps in translating the high-level use case into a detailed and implementable design.
18.
When a message is sent from an originating object to a destination object, in programming terms it means that the originating object is invoking a ____ on the destination object.
Correct Answer
B. Method
Explanation
When a message is sent from an originating object to a destination object in programming, it means that the originating object is invoking a method on the destination object. A method is a set of instructions or code that defines the behavior of an object. By invoking a method, the originating object is requesting the destination object to perform a specific action or behavior.
19.
The differences between programming languages and database languages have partially driven the trend to a ____ design.
Correct Answer
C. Multilayer
Explanation
The differences between programming languages and database languages have partially driven the trend to a multilayer design. This means that the design of systems and applications is becoming more complex and layered, with different programming and database languages being used for different layers. This allows for better separation of concerns and modularity, making it easier to develop and maintain large-scale software systems.
20.
In OO two-layer designs, the Structured Query Language (SQL) statements to access a database are part of the ____ layer.
Correct Answer
A. a. business logic
Explanation
In OO two-layer designs, the Structured Query Language (SQL) statements to access a database are part of the business logic layer. The business logic layer is responsible for implementing the business rules and logic of an application. It handles the processing of data and communicates with the data layer, which includes the database. Therefore, the SQL statements used to access the database are included in the business logic layer.