Interview Questions

Why is there no polymorphic-type response from a create() or find() method?

BEA WebLogic Questions and Answers


(Continued from previous question...)

Why is there no polymorphic-type response from a create() or find() method?

The EJB Specification prohibits this behavior, and the weblogic.ejbc compiler checks for this behavior and prohibits any polymorphic type of response from a create() or find() method.
The reason the create() and find() methods are not polymorphic is similar to the reason constructors are not polymorphic in Java. The derived classes generally do not know or cannot initialize the base class properly.

(Continued on next question...)

Other Interview Questions