<document>
  <header>
    <product>resin</product>
    <title>EJB Scrapbook</title>
    <version>Resin 3.0</version>
    <description>
      <p>A repository of notes and comments that will
        eventually make their way into the documentation.  Please
        treat the information here with caution, it has often not been
        verified.</p>
    </description>
  </header>

  <body>
    <summary objsummary-in-localtoc='1'/>

    <section title="Protocols">
      <faq title="What is meant by the 'wire protocol' or 'protocol' for remote EJB?">

      <p>Unfortunately, there's quite a bit of EJB documentation that
      seems to hide the fact the remote method calls need to use some
      wire protocol. So some of the books and tutorials will just use
      RMI and not explain that RMI is only one possible protocol for
      remote EJB.</p>

        <p>Resin's preferred protocols are Hessian and Burlap.  It does support 
          CORBA/IIOP, only because the spec requires it, but the support is pretty 
          minimal and it's not recommended.  The upcoming J2EE 1.4 spec might 
          require RMI and does require SOAP (but only for session
          interfaces.)</p>

        <p>(So why does Sun require specific wire protocols for EJB, when it 
          doesn't even require that you support SQL or databases for the CMP.  As 
          far as I can tell, it's all Sun politics, where the CORBA and RMI groups 
          think that by forcing the app servers to use their lame protocols, 
          they'll finally get somewhere in the marketplace.)</p>
      </faq>

      <faq title="Should I use Burlap or Hessian?">

        <p>Burlap and Hessian are almost identical.  Most of the files
        just globally replace Burlap with Hessian.</p>

        <p>Hessian is marginally better, since it doesn't have an issue
          with binary data or utf-8.  i.e. there's no encoding of the
          stream necessary.</p>

        <p>On the other hand, Burlap is easier to debug if that's ever necessary. 
          But it should be trivial to swap out Hessian for Burlap if you
          ever need to look at the stream.</p>

        <p>If you wanted an XML-based protocol for some reason you would
          use Burlap.  It's easier to look a the burlap data to try and
          debug what it's sending back and forth.</p>

        <p>Also, for something like Flash, it might be easier to parse
          XML rather than a binary protocol.</p>
      </faq>

      <faq title="Should I use Corba/IIOP?">
        <p>You don't want to use IIOP unless you really need to.</p>

        <p>Unless you are forced by some external requirement to use IIOP, use 
          something else.  Pretty much anything else is better than
          IIOP.</p>

        <p>CORBA/IIOP is a massively over-complex, confused, poorly designed, 
          unwieldly behemoth that only has some success because of huge
          amounts of pressure and advertisement from big companies like
          Sun and IBM.</p>

        <p>Even SOAP is better than CORBA/IIOP and SOAP is also overly-complex and 
          unwieldly.</p>
      </faq>
    </section>
  </body>
</document>
