Tag: programming languages

Questions Related to programming languages

  1. The bean method is throwing a checked exception and is configured with a transaction attribute of "Required".

  2. The bean method is throwing an unchecked exception and is configured with a transaction attribute of "Required".

  3. The bean does not throw an exception but is configured with a transaction attribute of "Mandatory".

  4. The bean method is throwing an unchecked exception and is configured with a transaction attribute of "Requires New".


Correct Option: B
  1. Cookies

  2. Entity Beans

  3. HttpSession attributes

  4. Stateful session beans

  5. URL Rewriting


Correct Option: D
Explanation:

To maintain client state, the user needs to know the different options available and which option is best suited to the given scenario.

A. Cookies: Cookies are small text files that are stored on the client's computer. They can be used to store client state information, such as user preferences or session IDs. While cookies can be effective for maintaining state, they have some limitations, such as a limited storage capacity and the potential for security vulnerabilities.

B. Entity Beans: Entity beans are used to represent persistent data in a Java Enterprise Edition (JEE) application. They are not designed to maintain client state.

C. HttpSession attributes: HttpSession attributes are used to store client-specific information on the server side. They are associated with a particular user session and can be used to maintain client state across multiple requests. This makes HttpSession attributes a good option for maintaining client state in a JEE application.

D. Stateful session beans: Stateful session beans are designed to maintain state across multiple requests. They are associated with a particular client and can be used to store client-specific information. This makes stateful session beans a good option for maintaining client state in a JEE application.

E. URL Rewriting: URL rewriting is a technique for adding session IDs to URLs. This allows the server to identify the client and maintain state across multiple requests. While URL rewriting can be effective for maintaining state, it has some limitations, such as the potential for security vulnerabilities and the impact on URL readability.

Based on the given scenario, the best option for maintaining client state is D. Stateful session beans, as they are designed to maintain state across multiple requests and are associated with a particular client. Option C. HttpSession attributes is also a good option since it can be used to maintain client state across multiple requests. Option A. Cookies and option E. URL Rewriting can also be used to maintain state but are less suited to the given scenario.

The Answer is: D. Stateful session beans

  1. BMP Entity bean

  2. CMP Entity bean

  3. Stateful Session bean

  4. Stateless Session bean

  5. Message Driven Bean


Correct Option: E
  1. Hides model complexity from the client

  2. Reduces network traffic

  3. Provides a simple interface to the client

  4. Enables the client to control transactions


Correct Option: D
  1. It is declared in the local home interface of a stateful session bean.

  2. It is declared in the local home interface of a stateless session bean.

  3. It is declared in the remote home interface of a stateful session bean.

  4. It is declared in the remote home interface of a stateless session bean.


Correct Option: C
  1. EJBs are not allowed to open a socket to connect to a FTP server and download a document.

  2. EJBs are not allowed to log an error to a file on disk.

  3. EJBs are allowed to install a new security manager when they have to perform highly secure jobs.

  4. EJBs are allowed to invoke Class.getResource in order to retrieve bundled resources (images, texts, properties, etc).

  5. EJBs are allowed to create small java.awt.Window components in order to display business processing errors or exception messages.

  6. EJBs are allowed to spawn their own threads in order to perform some time-consuming tasks, for example.


Correct Option: B,D

Which of the following combinations (Design Pattern - Functionality) regarding Design Patterns is correct?

  1. Business Delegate - Reduces the coupling between presentation-tier clients and business services.

  2. Data Access Object - Multiple View using the same model.

  3. MVC - Enables easier migration to different persistence storage implementation.

  4. Value Object - Reduces Network Traffic


Correct Option: D