EJB : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

EJB
EJB (Enterprise Java Beans). EJBs (Enterprise Java Beanses) are used mainly by large corporations. They are not something to concern the fledgling Java programmer. They are complicated. I can only give an arm waving overview that won’t enlighten much. You have to study them in detail before you even begin to understand what they are for. EJBs are probably the most difficult part of Java.

Here is a rule of thumb. If your application is so complicated that it will have to be distributed over several servers, have a look at EJB. If not, use a simpler technology.

Enterprise beans don’t have a GUI (Graphic User Interface) interface. Enterprise Java Beans speak CORBA (Common Object Request Broker Architecture) IIOP (Invocation over Internet Inter-Orb Protocol) for their RMI (Remote Method Invocation). Session Beans maintain conversational context for one client. Entity beans cache data for one row of a database. Entity beans also provide a simple persistent object database, indexed by a primary key. The Entity bean learns its primary key at create time and may persist indefinitely. Beans make it easier to implement transaction logic with commit/rollback. The transaction processing logic helps keeps beans from interfering with each other. EJBs use JNDI to find objects. They use RMI (regular or IIOP Corba) to communicate between servers. They use JTA (Java Transaction Application programming interface) for transaction management.

The point of EJB is to fob much of the work of concurrency, transaction handling and persistence off on the container so the beans can concentrate on business logic.

There are several types of beans. This diagram outlines them:

bean types

Beans communicate via two proxy objects, one that implements the bean’s home (bean-finding) interface and one that implements its remote (business-logic) interface. The indirection allows the EJB container to intercept the calls and add functionality such as persistence.

Bean Flavours

EJBs come in a number of flavors.
  1. Entity beans

    Entity beans are used to represent data in a database. There are two flavors of entity beans, BMP (Bitmap) and ( CMP (Container Managed Persistence)). With CMP the container handles generating all the SQL (Standard Query Language). With BMP you have to write the SQL. A typical simple use-case is that a single instance of an entity bean represents a row in a database. Many people have soured on entity beans and prefer a simpler approach like Hibernate. In fact, the new EJB specifications endeavor to make entity beans more like Hibernate.
  2. Session beans

    Session beans are essentially service providers. A typical use-case is to encapsulate high-level business logic. For example, a session bean for a bank might implement an electronic transfer. Session beans can be stateful or stateless. A stateful session bean maintains a conversational state between itself and the client. A stateless session bean does not; a client might get completely different bean instances from one call to the next, even with the same handle.
  3. MDB (Message-Driven Bean) ( MDB)

    Message driven beans are capable of responding to JMS (Java Messaging Service) messages. (The other types of beans are not able to do this do to the restrictions of the bean container.) MDB work asynchronously, the other bean types are synchronous. MDB can post JMS messages and that can be used as a return value of sorts.

Advantages of EJB s

Using EJBs gives you a number of things. The biggest thing is the server environment. You do not need to implement all the things that go with a server, like threading, polling, security, etc.

Using EJBs also takes away a number of things. You are not allowed to do certain things within the EJB container, e. g., you should not create threads, do file IO, listen on a socket, etc.

Books

book cover recommend book⇒Enterprise JavaBeans 3.1, sixth editionto book home
by Bill Burke, Richard Monson-Haefel 978-0-596-15802-6 paperback
birth 1971 age:46 978-1-4493-9696-1 eBook
publisher O’Reilly recommended B0046RERXO kindle
published 2010-09-17
covers JBOSS. Also high level information for managers and tips on design.
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.
book cover recommend book⇒Building Java Enterprise Applications Volume I: Architectureto book home
by Brett McLaughlin 978-0-596-00123-0 paperback
publisher O’Reilly recommended
published 2002-03
Aimed at experienced developers. Filled with particularly good advice on using EJBs and LDAP directory services Highly recommended. First volume of a three volume set on EE.
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.
There are many different ways of using EJB s, sometimes called idioms.

This page is posted
on the web at:

http://mindprod.com/jgloss/ejb.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\ejb.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[18.208.203.36]
You are visitor number