Tuesday, May 8, 2012

What is software architecture of EJB?



Session and Entity EJBs consist of 4 and 5 parts respetively:

1. A remote interface (a client interacts with it),

2. A home interface (used for creating objects and for declaring business methods),

3. A bean object (an object, which actually performs business logic and EJB-specific operations).

4. A deployment descriptor (an XML file containing all information required for maintaining the EJB) or a set of deployment descriptors (if you are using some container-specific features).

5.A Primary Key class - is only Entity bean specific.

What makes J2EE suitable for distributed multitiered applications?


What makes J2EE suitable for distributed multitiered applications?

The J2EE platform uses a multitiered distributed application model. Application logic is divided into components according to function, and the various application

components that make up a J2EE application are installed on different machines depending on the tier in the multitiered J2EE environment to which the application component belongs


Client-tier components run on the client machine.
Web-tier components run on the J2EE server.
Business-tier components run on the J2EE server.
Enterprise information system (EIS)-tier software runs on the EIS server.

What are the components of J2EE application?


What are the components of J2EE application?

Application clients and applets are client components.
Java Servlet and JavaServer Pages technology components are web components.
Enterprise JavaBeans components (enterprise beans) are business components.

Are JavaBeans J2EE components?


Are JavaBeans J2EE components?
No.JavaBeans components written for the J2EE platform have instance variables and get and set methods for accessing the data in the instance variables.

Differences between EJB 3.0 and EJB 2.1


Differences between EJB 3.0 and EJB 2.1

EJB2.0 has Deployment descriptors but in EJB3.0 has no Deployment Descriptors.
EJB2.0 we have to write Home and Remote Interfaces But in EJB3.0 No need to write Home and remote interfaces

Compared to EJB 2.1, EJB 3.0 simplifies the process of creating Enterprise JavaBean applications.

The underlying concept of the EJB 3.0 specification centers on a plain old Java™ object (POJO) programming model that uses Java annotations to capture information that deployment descriptors used to contain

Deployment descriptors are now optional in most cases.

session beans also no longer require EJB-specific component interfaces either.

EJB 3.0 has introduced a lightweight entity bean persistence mechanism through the Java Persistence API. These entities are POJO based and can then be run outside of an EJB container and do not require any interfaces or EJB code in them

What is the EAR file?

An EAR file is a standard JAR file with an .ear extension, named from Enterprise ARchive file. A J2EE application with all of its modules is delivered in EAR file.