entity java beans
DESCRIPTION
Entity Java Beans. Jorg Janke http://www.compiere.org Open Source ERP & CRM. Objectives. Know J2EE & EJB Buzzwords Understanding of J2EE Architecture Understanding of EJB Architecture Know next steps to explore J2EE & EJB. Java Application Tiers. Java Application Tiers (Detail). J2SE. - PowerPoint PPT PresentationTRANSCRIPT
![Page 2: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/2.jpg)
Objectives Know J2EE & EJB Buzzwords Understanding of J2EE Architecture Understanding of EJB Architecture Know next steps to explore J2EE &
EJB
![Page 3: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/3.jpg)
Java Application Tiers
![Page 4: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/4.jpg)
Java Application Tiers (Detail)
![Page 5: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/5.jpg)
J2SE
![Page 6: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/6.jpg)
EJB Types Session Beans
Stateless Stateful
Entity Bean Bean Managed Persistency Container Managed Persistency (CMP)
Message Bean
![Page 7: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/7.jpg)
Stateless Session Bean
![Page 8: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/8.jpg)
Stateful Session Bean
![Page 9: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/9.jpg)
Entity Bean
![Page 10: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/10.jpg)
Message Bean
![Page 11: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/11.jpg)
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)
![Page 12: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/12.jpg)
EJB Runtime Home (“create”, “find”)
Home Object Stub Home Object
EJB (“business methods”) EJB Object Stub EJB Object
Bean (“the entity”) Enterprise Bean Object
![Page 13: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/13.jpg)
EJB Container - Client
Client Container
Home Stub Home Stub
Object Stub Object Stub
RMI-IIOP
Home Object
EJB Object
Enterprise Bean Object
JNDI
![Page 14: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/14.jpg)
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 -> myBean
Bean.doSomething(); Business Method “Proxy”
![Page 15: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/15.jpg)
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
![Page 16: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/16.jpg)
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
![Page 17: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/17.jpg)
For a live demo … visit me
![Page 18: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/18.jpg)
JBuilder New …
![Page 19: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/19.jpg)
New Module (multiple Beans)
![Page 20: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/20.jpg)
New Session Bean
![Page 21: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/21.jpg)
Stateless Session Bean
![Page 22: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/22.jpg)
Session Bean Properties
![Page 23: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/23.jpg)
Home Interface
![Page 24: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/24.jpg)
Remote Interface
![Page 25: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/25.jpg)
Bean Class
![Page 26: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/26.jpg)
Deployment Descriptor
![Page 27: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/27.jpg)
Add additional methods …
![Page 28: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/28.jpg)
Create Test Client
![Page 29: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/29.jpg)
Client 1 – Lookup
![Page 30: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/30.jpg)
Client 1 - Create
![Page 31: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/31.jpg)
Client 1 – Business Methods
![Page 32: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/32.jpg)
Entity Bean
![Page 33: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/33.jpg)
Home Interface
![Page 34: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/34.jpg)
Remote Interface
![Page 35: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/35.jpg)
Bean Class
![Page 36: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/36.jpg)
Client 2
![Page 37: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/37.jpg)
Client 2 – Lookup / Create
![Page 38: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/38.jpg)
Client 2 – Business Methods
![Page 39: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/39.jpg)
Java Application Tiers
![Page 40: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/40.jpg)
How do EJBs “fit in” Application Server Business Objects Coarse Grained Objects Fine Grained Objects (not suited)
Local Interface
![Page 41: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/41.jpg)
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
![Page 42: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/42.jpg)
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
![Page 43: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/43.jpg)
Compiere & J2EE Compiere does not use EJBs EJB Container (candidate: JBoss)
Additional Installation effort Additional Operation effort Plus: Could be installed automatically
Compiere’s Business Objects (Invoice,..) dynamically are generated Based on Data Dictionary Business Objects & Behavior are
“personalized”
![Page 44: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/44.jpg)
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 (O’Reilly)
![Page 45: Entity Java Beans](https://reader030.vdocuments.us/reader030/viewer/2022012404/56816837550346895dddfaa8/html5/thumbnails/45.jpg)
Thanks You can download the presentation
http://www.compiere.org/download
My contact: http://www.compiere.com/consulting.
html [email protected]