Entity Java Beans - PowerPoint PPT Presentation

About This Presentation
Title:

Entity Java Beans

Description:

Objectives Know J2EE & EJB Buzzwords Understanding of J2EE Architecture Understanding of EJB Architecture Know next steps to explore J2EE & EJB Java Application ... – PowerPoint PPT presentation

Number of Views:105
Avg rating:3.0/5.0
Slides: 46
Provided by: JorgJ5
Category:
Tags: beans | entity | java

less

Transcript and Presenter's Notes

Title: Entity Java Beans


1
Entity Java Beans
  • Jorg Janke
  • http//www.compiere.org
  • Open Source ERP CRM

2
Objectives
  • Know J2EE EJB Buzzwords
  • Understanding of J2EE Architecture
  • Understanding of EJB Architecture
  • Know next steps to explore J2EE EJB

3
Java Application Tiers
4
Java Application Tiers (Detail)
5
J2SE
6
EJB Types
  • Session Beans
  • Stateless
  • Stateful
  • Entity Bean
  • Bean Managed Persistency
  • Container Managed Persistency (CMP)
  • Message Bean

7
Stateless Session Bean
8
Stateful Session Bean
9
Entity Bean
10
Message Bean
11
EJB Source Code
  • Home Interface (extends EJBHome)
  • Create - Find (for Entity)
  • Factory Pattern
  • Remote Interface (EJBObject)
  • Business Methods
  • Proxy Pattern
  • Bean Class (EntityBean/SessionBean)
  • Deployment descriptor (ejb-jar.xml)

12
EJB Runtime
  • Home (create, find)
  • Home Object Stub
  • Home Object
  • EJB (business methods)
  • EJB Object Stub
  • EJB Object
  • Bean (the entity)
  • Enterprise Bean Object

13
EJB Container - Client
JNDI
Client
Container
Home Object
Home Stub
Home Stub
RMI-IIOP
Enterprise Bean Object
EJB Object
Object Stub
Object Stub
14
EJB Use
  • Context ctx new InitialContext()
  • JNDI to LDAP or other Directory Service
  • BeanHome home ctx.lookup(myBean")
  • Container finds/creates Factory
  • BeanRemote bean home.create()
  • Container creates EJB Object -gt myBean
  • Bean.doSomething()
  • Business Method Proxy

15
Getting started
  • The hard way
  • Download, Install Implement the J2EE Reference
    Implementation (Cloudscape)
  • The easy way
  • Select a IDE
  • J2EE support often in Enterprise Edition
  • Free Forte / NetBeans

16
Now you have your IDE
  • Check what Containers are supported (or included)
  • Download Install the Container
  • E.g. JBoss includes Tomcat
  • IDEs provide
  • Wizards / Templates
  • Packaging Deployment

17
For a live demo visit me
18
JBuilder New
19
New Module (multiple Beans)
20
New Session Bean
21
Stateless Session Bean
22
Session Bean Properties
23
Home Interface
24
Remote Interface
25
Bean Class
26
Deployment Descriptor
27
Add additional methods
28
Create Test Client
29
Client 1 Lookup
30
Client 1 - Create
31
Client 1 Business Methods
32
Entity Bean
33
Home Interface
34
Remote Interface
35
Bean Class
36
Client 2
37
Client 2 Lookup / Create
38
Client 2 Business Methods
39
Java Application Tiers
40
How do EJBs fit in
  • Application Server
  • Business Objects
  • Coarse Grained Objects
  • Fine Grained Objects (not suited)
  • Local Interface

41
What is J2EE compliant
  • Server providing
  • Web Services
  • Servlet, JSP
  • JNDI, RMI, JDBC
  • EJB Services
  • EJB with CMP
  • JMS, JTA, JAAS
  • Compliance Test
  • Version 1.2, 1.3,
  • License
  • Application using
  • One of the technologies
  • Servlet or RMI JDBC will do

42
When to use EJBs
  • You need a EJB project for your CV
  • Highly shared, long lived objects
  • Entity Beans
  • Container Managed Persistency (CMP)
  • Data Access Object
  • Receiving Messages (JMS)
  • (Simple) Transaction Support (outside JDBC)
  • Security Support

43
Compiere J2EE
  • Compiere does not use EJBs
  • EJB Container (candidate JBoss)
  • Additional Installation effort
  • Additional Operation effort
  • Plus Could be installed automatically
  • Compieres Business Objects (Invoice,..)
    dynamically are generated
  • Based on Data Dictionary
  • Business Objects Behavior are personalized

44
Intro Resources
  • http//java.sun.com/j2ee/
  • Deployathon
  • http//java.sun.com/blueprints
  • http//java.sun.com/j2ee/tutorial
  • J2EE community sites
  • http//www.theserverside.com
  • http//www.middleware-company.com/
  • http//www.onjava.com (OReilly)

45
Thanks
  • You can download the presentation
  • http//www.compiere.org/download
  • My contact
  • http//www.compiere.com/consulting.html
  • jorg.janke_at_compiere.org
Write a Comment
User Comments (0)
About PowerShow.com