Discussions

General J2EE: Where is the actual implementation of the following interfaces..

  1. Hello every body,

        I havae a big question??
     
      1. In EJB alll are interfaces named EntityBean, EntityContext....... with abstract methods.There are no classes.
         But we are going to call the abstract methods like ejbCreate()... and so on.
      Where is the actual implementation and who is going to implement and when it will be done.

       If so, let say that it is done by the container it self for every methode...

      But in core java the same thing is happening for Enumeratins interface

      2. when we are going to use the method elements()in any one of the collection class we are getting a return type of Enumeretion . And directly we are going to use the methods which are declared, but not defined in the Enumeration interface named hasNextElement(), and nextElement()...
    But where the actual implementation... and which code is going to run when these methods are called..


      in waiting for ur reply

    Maru.
  2. The implementation of the EJB interfaces is EJB-server specific. Similarly, the implementation of the Enumeration interface is generally specific to the collection from which you got the Enumeration.

    As a general rule, the implementation class of an interface is something that a developer should not need to worry about. The interface describes WHAT the class will, and HOW the class does it should be unimportant.
  3. You could try running the EJB compiler for your container if it has one and decompile the generated class files in the new jar file. This will give you an idea of what the generated Classes get up to.
  4. Hye Maru,
           Whenever you are creating the stubs and skeletons for the EJBS at that time it will write the implementation.

    regards
    Samudrala Vinay Kumar