Beans Java Interview Questions – Set 01

What is binding (JavaServer Faces technology) ?

Wiring UI components to back-end data sources such as backing bean properties.

What is caller principal ?

The principal that identifies the invoker of the enterprise bean method.

What is backing bean ?

A JavaBeans component that corresponds to a JSP page that includes JavaServer Faces components. The backing bean defines properties for the components on the page and methods that perform processing for the component. This processing includes event handling, validation, and processing associated with navigation.

What is cascade delete ?

A deletion that triggers another deletion. A cascade delete can be specified for an entity bean that has container-managed persistence

What is business logic ?

The code that implements the functionality of an application. In the Enterprise JavaBeans architecture, this logic is implemented by the methods of an enterprise bean.

What is business method ?

A method of an enterprise bean that implements the business logic or rules of an application.

What is bean-managed persistence

The mechanism whereby data transfer between an entity bean’s variables and a resource manager is managed by the entity bean.

What is the difference between Session bean and Entity bean?

The Session bean and Entity bean are two main parts of EJB container.

Session Bean

  • represents a workflow on behalf of a client
  • one-to-one logical mapping to a client
  • created and destroyed by a client
  • not permanent objects
  • lives its EJB container(generally) does noot survive system shut down
  • There are two two types of Session Bean:
    • stateless session bean
    • stateful session bean

Entity Bean

  • represents persistent data and behavior off this data
  • can be shared among multiple clients
  • persists across multiple invocations
  • findable permanent objects
  • outlives its EJB container, survives systeem shutdown
  • There are two two types of Entity Bean:
    • container managed persistence(CCMP)
    • bean managed persistence(BMP)

What are the components of J2EE application?

A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:

  • Application clients and applets are client components.
  • Java Servlet and JavaServer PagesTM (JSPTM) technology components are web components.
  • Enterprise JavaBeansTM (EJBTM) components (enterprise beans) are business components.
  • Resource adapter components provided by EIS and tool vendors.

What is bean-managed transaction ?

A transaction whose boundaries are defined by an enterprise bean.