Q&A

Q1:Can a J2EE application be written without using any Enterprise JavaBeans?
A1: Certainly. You can write a Web client application that connects to a servlet in a Web container and have that servlet connect directly to a back-end database. You don't need to add an EJB. An EJB can add value by providing persistent conversational state if that is required. It can also provide transactional security and roll back to a previous state should there be an interruption in the flow of data for any reason.
Q2:Can a J2EE application be written without using any Web components?
A2: Certainly. You can write a standalone client application that connects directly to an EJB without the need for a Web-based interface.
Q3:What type of EJB should I typically use to encapsulate business logic? And which type would I use to contain data and its associated operations?
A3: For pure business logic, you would typically use a Session bean. If the EJB is to represent underlying application data, you would probably use an Entity bean.
Q4:How do you package an EJB? What should be in the package?
A4: An EJB is packaged in an EJB-JAR file. The EJB-JAR file contains the classes for the EJB, any other resources, and a deployment descriptor that contains EJB metadata and describes the external resource requirements of the EJB.
Q5:What is an EAR file?
A5: An EAR file houses the application's JAR, WAR, and deployment descriptor files. The Assembler takes on the responsibility of packaging the EAR file, while the Deployer authenticates that the file conforms to the J2EE specification, adds the file to the J2EE server, and deploys the application.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.100.212