2 Replies Latest reply on Dec 14, 2004 8:45 AM by Bill Burke

    Using Interfaces for Entity Beans

    Mike Duffy Novice

      The EJB 3.0 Spec, in section "2.2 Business Interfaces", states "Business interfaces in the sense of this chapter are not defined for entity beans[1]." The spec goes on to say, "The developer may choose to layer business interfaces on entity beans. The techniques for doing this are not defined by this specification."

      In another reference, "6.1 Requirements on the Entity Bean Class", the spec states, "If the entity bean is to be passed by value as a detached object (e.g., through a remote interface), it must implement the Serializable interface."

      I noticed in the JBoss EJB 3.0 tutorial that all the entity beans do in fact implement a bsuiness interface and the interfaces are @Remote instead of @Local.

      Two questions:

      What are the advantages of implementing an interface for an enity bean?

      What are the advantages of implementing of implementing a @Remote interface instead of a @Local interface?