1 / 39

EJB Design

EJB Design. Server-side components. Perform complex algorithms high volume transactions Run in highly available environment (365 days/year) fault tolerant transactional secure. Basic Philosophy. Enterprise applications are complex As they grow, specialization is a necessity

almira
Download Presentation

EJB Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EJB Design

  2. Server-side components • Perform • complex algorithms • high volume transactions • Run in • highly available environment (365 days/year) • fault tolerant • transactional • secure

  3. Basic Philosophy • Enterprise applications are complex • As they grow, specialization is a necessity • Local control should be more focused on business/application specific issues • Infrastructure issues should be left to specialists • Many application issues are common • Buying and assembling is better when possible • Scalability is beyond the scope of most developers

  4. Bean Provider java beans EJB Application Assembler uses beans to build builds user interfaces and additional beans Deployer performance and secxurity Systems Admin handles problems of day-to-day running Container and Server Provider Tool Provider IDEs testing build Persistence manager Players in EJB System

  5. Basic Architecture

  6. User Interface Our Focus Business Logic Database (infrastructure)

  7. 3 -layer • Separate for independence as in any layer design • Application specific logic in business layer • Reuse and scale business and infrastrucure layers without impacting the others • As new interface technologies emerge, logic doesn’t (e.g., cell phone internet access)

  8. How do the components interact? • Most of the communication between layers, both interlayer and intralayer are some type of remote procedure call. • Lots of technologies all basically the same • RPC • RMI • Corba • DCOM • Also a need to preserve connectors to legacy system for evolution/migration needs

  9. Main components • Servers to manage complexity in first slide • Servers are housed in containers • Two containers • EJB • Web • Database/infrastructure • Input from java apps, web interfaces, legacy and related technologies (Corba).

  10. Input Container • Manages two main technologies • JSP • Servlets • Handles issues of scalability, security, fault-tolerance, etc.

  11. EJB container • Entity Beans • data objects • typically connected to database entries • Session Beans • logic operations • stateful and stateless • Message Beans • asynchronous message exchange between beans • like mail senders, readers

  12. Remote calls • Allows for execution of logic on a machine other than the one caller executes on • Requires using a stub for initiating and receiving the call. • Takes the caller and creates • caller and calling stub • Takes the procedure and creates • receiving stub and procedure

  13. Call appears local! Worries about socket calls parameter packaging Worries about receiving socket calls unpackaging parameters

  14. Container simplifies Bean

  15. Container simplifies Bean Typical business function interaction would be

  16. Container simplifies Bean Business bean interaction would preferably be Hertz used to say “leave the driving to us”. Containers would say “leave the rest to us”.

  17. Smart! Knows everything else Dumb! Only knows business logic.

  18. You don’t implement.. Container does that!

  19. EJB Overhead for an example remote call.

  20. To Deploy Must Use JAR • Contents include everything the container will need to manage it • Class files • Deployment descriptors • Zip format

  21. Hello World Our first example!

  22. REMOTE INTERFACE Remember it’s an interface (prototype) Insert prototype for the functionality you need .. hello()

  23. HOME INTERFACE Remember it’s an interface (prototype) Insert prototype for the functionality you need .. hello()

  24. The Session Bean

  25. SESSION BEAN

  26. Bean Queries the contain via Context

  27. DEPLOYMENT DESCRIPTOR - JAR

  28. Simple Client-side Interaction with the EJB

More Related