EJB Flashcards
1
Q
EJB
A
Enterprise Java Beans
- one of the several Java APIs for standard manufacture of enterprise software
- a server-side software element that summarizes the business logic of an application
- we need an application server (EJB container) such as Jboss, Glassfish, Weblogic, Websphere, etc. to run the EJB application.
- If you need a component that accesses the database or is accessed from multiple clients
2
Q
JavaBean
A
A type of java class that encapsulates many objects into a single object (the bean)
It follows certain standards:
- it should be Serializable (must implement Serializable)
- it should have a (public) no-arg constructor
- All properties must be private with public getter and setter methods
3
Q
There are 3 types of EJB
A
- Session Bean
- Entity Bean
- Message Drive Bean
4
Q
Session Bean
A
- It stores data of a particular user for a single session. It gets destroyed as soon as the user session terminates.
- It contains business logic that can be invoked by local, remote, or web service clients.
- when a client wants to use an application distributed on a server
5
Q
Entity Bean
A
- it represents persistent data storage. user data can be saved to the database via entity beans and later on be retrieved from the database.
- it is deprecated and now replaced with JPA (Java Persistent API).
6
Q
SessionBean Interface
A
it defines methods that the EJB container uses to notify a session bean instance of the instance’s life cycle events