Chapter 23: Entity Beans - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Chapter 23: Entity Beans

Description:

... Beans. Reference: Building J2EE Apps with WebSphere. 2. Objectives ... IBM-specific JavaBean wrappers; may not be portable to other J2EE servers. EJB Security ... – PowerPoint PPT presentation

Number of Views:57
Avg rating:3.0/5.0
Slides: 13
Provided by: conest
Category:

less

Transcript and Presenter's Notes

Title: Chapter 23: Entity Beans


1
Chapter 23 Entity Beans
Reference Building J2EE Apps with WebSphere
2
Objectives
  • Discuss transactional properties of EJBs
  • Discuss EJB-QL
  • Discuss Business Tier J2EE Patterns
  • Value Objects
  • Session Façade
  • Advanced EJB Topics
  • Not covered in this course

3
EJB Transactional Characteristics
  • Reference Pages 552 - 556
  • The EJB specification gives you options for
    defining transactions
  • Container managed transactions (CMT)
  • For reusability, set Required for all session
    beans and entity beans
  • Bean managed transactions (BMT)
  • Less flexible
  • Client demarked transaction

4
EJB Transactional Levels
5
EJB Transactional Levels (Cont.)
6
EJB Transactional Levels (Cont.)
7
EJB Query Language
  • Enterprise JavaBean Query Language (EJB QL) was
    introduced in the EJB 2.0 specification to
    support the abstract persistence model
  • EJB QL language for expressing the equivalent of
    SQL SELECT statements for CMP beans
  • Useful for generating code for custom Find method
  • E.g. findAll() method (pages 556 558)
  • SELECT object(itm) FROM Item AS itm ORDER BY
    itm.name

8
Comparing EJB QL and SQL Statements
9
Value Object Pattern
  • Reference Pages 559 - 560
  • To avoid multiple getter and setter method calls
    between client and EJBs.
  • Value Object pattern makes use of JavaBeans
  • Implements java.io.Serializable
  • Has getter and setter methods
  • Without Value Objects
  • Use multiple method arguments in Session beans
    business methods
  • E.g., setItemDetails(int, String) instead of
    setItemDetails(ItemVO)

10
Session Façade Pattern
  • Reference Pages 561 - 567
  • Encapsulates the complexity of interactions
    between business objects participating in the
    application workflow.
  • Benefits
  • Reduce tight coupling between client and business
    objects (EJBs)
  • Reduce number of business method invocations
    between client and server
  • Protect misuse of business objects by imposing a
    uniform access strategy for clients

11
Web Clients
  • Reference Pages 569 - 578
  • Front Controller Pattern
  • Only one servlet services multiple commands
  • Command Pattern
  • Delegates a request to the command handler
  • Matches a command to a specific JSP view.
  • Note This is an advanced topic
  • Not covered in this course

12
Advanced EJB Topics
  • Reference Pages 586 - 588
  • Message-Driven Beans
  • initiates processing in response to an external
    event resembles stateless session beans
  • Access Beans
  • IBM-specific JavaBean wrappers may not be
    portable to other J2EE servers
  • EJB Security
  • EJB developers are not responsible for user
    authentication or authorization (mapping the
    user to a role)
Write a Comment
User Comments (0)
About PowerShow.com