Enterprise JavaBeans - PowerPoint PPT Presentation

enterprise javabeans n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Enterprise JavaBeans PowerPoint Presentation
Download Presentation
Enterprise JavaBeans

play fullscreen
1 / 87
Enterprise JavaBeans
175 Views
Download Presentation
Download Presentation

Enterprise JavaBeans

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Enterprise JavaBeans

  2. Lesson 1:Introduction to Server-Side Component Software

  3. Objectives • Define client-server and multi-tier architecture • Discuss the benefits and issues of distributed architectures • Define software components • Discuss server-side component architecture and architecture solutions • Define J2EE technologies • Define EJB technology

  4. Client-Server andMulti-Tiered Architectures • Scalability • Extensibility • Security • Issues concerning distributed architectures • Complexity • Communication/bandwidth • Maintenance costs

  5. CentralizedMainframe Architecture

  6. Two-TierArchitecture

  7. Three-TierArchitecture

  8. SoftwareComponents • Component architectures • Component development tools • Container • Maintenance deployment tools

  9. ComponentArchitecture Solutions • .NET Enterprise Architecture • CORBA • J2EE

  10. EJB RMI/RMI-IIOP JNDI JDBC JTA/JTS JMS JSP IDL JavaMail Connectors XML J2EETechnologies

  11. EnterpriseJavaBeans • Differences between JavaBeans and Enterprise JavaBeans • EJB development tasks • J2EE product provider • Bean developer • Application assembler • Deployer • System administrator • Tool provider

  12. Summary • Define client-server and multi-tier architecture • Discuss the benefits and issues of distributed architectures • Define software components • Discuss server-side component architecture and architecture solutions • Define J2EE technologies • Define EJB technology

  13. Lesson 2:Overview of the Enterprise JavaBeans Framework

  14. Objectives • Define an EJB server’s main components • Discuss EJB and client interaction • Identify EJB container services • Describe home objects and EJB objects • Compare session beans and entity beans • Define a deployment descriptor • Identify the EJB-JAR file

  15. EJBArchitecture • Primary components • EJB-compliant server • EJB-compliant container • Home object (bean factory) • EJB object (remote interface) • EJB

  16. Example ofEJB Architecture

  17. Client Interactionwith Enterprise JavaBeans

  18. EJBContainer Services • Distributed transaction management • Persistence • Security • Component resource and life cycle management • Remote accessibility • Transparent location of components • Identification of components

  19. The EJBHome Object • Location transparency

  20. TheEJB Object Stubs Skeletons

  21. Types ofEnterprise JavaBeans • Session beans • Stateful • Stateless • Entity beans

  22. DeploymentDescriptors • An XML document that describes the properties of an EJB

  23. TheEJB-JAR File • Contains the class files for a bean, its home and remote interfaces, and the deployment descriptors

  24. Summary • Define an EJB server’s main components • Discuss EJB and client interaction • Identify EJB container services • Describe home objects and EJB objects • Compare session beans and entity beans • Define a deployment descriptor • Identify the EJB-JAR file

  25. Lesson 3:Creating Session Beans

  26. Objectives • Define the methods of the SessionBean interface • Describe the EJBContext and the SessionContext interfaces • Contrast stateful and stateless session beans • Explain how to write business methods for a session bean • Discuss the enterprise bean’s life cycle

  27. Objectives (cont’d) • Create a session bean • Define the EJBHome and EJBObject interfaces and their methods • Discuss the superclass for the home and remote interfaces • Describe system and application exceptions • Deploy and connect to a session bean

  28. Creating theEnterprise Bean Class • ejbCreate methods • The SessionBean interface • The EJBContext interface • The SessionContext interface

  29. Stateless andStateful Session Beans • Stateless session beans • Do not keep track of any information from one method call to the next • Stateful session beans • Can change their state during a conversation with a client

  30. Writing Business Methods for an Enterprise Bean • Each EJB must declare the business methods that define the work that the EJB is designed to perform

  31. The Home Interface • Extends EJBHome • Provides mechanisms to create and remove EJB components

  32. The EJB Object • Extends the EJBObject interface

  33. Exceptions in EJB • System exceptions • Application exceptions

  34. Example:A Session Bean • The Teller bean class • The Teller remote interface • The Teller home interface

  35. The LibraryApplication • The Book entity bean • The Patron entity bean • The CheckOutRecord entity bean • The CheckOut session bean • The CheckIn session bean

  36. LibraryDBSchema

  37. Introduction toEJB Deployment • The deployment descriptor • DD XML tags • Environment data • Environment property XML tags • Accessing environment data • Using bean references • EJB reference XML tags • Using the EJB reference • Using resource factories • Factory resource XML tags

  38. AdditionalDeployment Concepts • Assembler/deployer roles with the deployment descriptor • EJB deployment in an EJB server

  39. Summary • Define the methods of the SessionBean interface • Describe the EJBContext and the SessionContext interfaces • Contrast stateful and stateless session beans • Explain how to write business methods for a session bean • Discuss the enterprise bean’s life cycle

  40. Summary (cont’d) • Create a session bean • Define the EJBHome and EJBObject interfaces and their methods • Discuss the superclass for the home and remote interfaces • Describe system and application exceptions • Deploy and connect to a session bean

  41. Lesson 4: Entity Beans

  42. Objectives • Discuss entity beans and their persistence management techniques • Identify the methods of the EntityBean and EntityContext interfaces • Define primary keys and their use • Describe the mechanics involved in entity beans • Use finder methods • Write an entity bean and its required interfaces

  43. What Is an Entity Bean? • The EntityBean interface • The EntityContext interface • Primary keys

  44. Entity BeanArchitecture • Creating entity beans • Invoking business methods on entity beans • Swapping entity beans • Invoking remove( ) on an entity bean • Life cycle of an entity bean instance

  45. Life Cycle of anEntity Bean Instance

  46. Bean-ManagedPersistence • Using JDBC • Using a resource factory to connect to a database

  47. UsingResource Factories

  48. Entity Bean Methods • The ejbCreate( ) method • The ejbPostCreate( ) method • The ejbRemove( ) method • The ejbLoad( ) method • The ejbStore( ) method

  49. UsingFinder Methods • The ejbFindByPrimaryKey( ) method • Multiple row finders

  50. The Remote Interface • All remote interfaces extend javax.ejb.EJBObject