Multiple choice technology architecture

What is the biggest difference between Message-Driven Beans and Entity and Session Beans?

  1. There is no difference in structure between Message-Driven Beans and Entity and Session Beans. They all have home, remote interfaces and a bean class.

  2. Message-Driven beans don't have a home interface.

  3. A Message Driven bean is different from Session Bean because its state is persisted.

  4. Clients do not access Message-Driven beans through interfaces.

Reveal answer Fill a bubble to check yourself
B,D Correct answer
Explanation

Message-Driven Beans differ from Entity and Session Beans in two fundamental ways: they don't have home interfaces (only a bean class with annotations), and clients never access them directly through interfaces (remote or local). MDBs are invoked by the container when messages arrive, not by client calls. They also don't have component interfaces like Session/Entity beans. Option A is false because MDBs lack home and component interfaces. Option C is wrong because MDBs are stateless and don't persist state themselves.

AI explanation

In EJB, Message-Driven Beans (MDBs) differ structurally from Entity/Session Beans: MDBs have no home or remote interface at all — they only implement the MessageListener (and bean) interfaces, so clients never look them up via JNDI or invoke them through an interface; instead the container delivers JMS messages to them asynchronously. That's why both 'no home interface' and 'clients do not access via interfaces' are correct. The first option is wrong because MDBs explicitly lack home/remote interfaces, unlike Session/Entity beans. The 'state is persisted' option is wrong — MDBs are stateless message consumers; persistence describes Entity Beans, not what differentiates MDBs from Session Beans.