On Sun, 3 Nov 2002, [EMAIL PROTECTED] wrote:
> Galen Boyer writes:
>  >
>  > Along these lines, is there any EJB remote, home and bean
>  > generation help developed?
>  >
>
> Hi Galen,
>
> The latest version of the JDEE, 2.2.9beta12, has templates for
> generating EJB session and entity beans automatically. For
> example, to generate a session bean, select JDE New->EJB->Session
> from the Emacs File menu.

Hi Paul,

I never actually looked there.  I was trying to make this happen
by

    JDE -> Code Generation -> Wizards -> Implement Interface

Right now this drill isn't working correctly.  I'm sure its a
classpath issue.  Question.  You hardcoded these interface
implementations outside of the above menu choices to allow for a
user to customize what the defaults might be?  I think this is
probably pretty smart.  Things like a default ejbActivate and
ejbPassivate code would be shop specific. (BTW, your EntityBean
default doesn't have the incantation of "implements EntityBean"
in the generated code, very minor bug.)

The functionality I was searching for is to be able to create one
file which implemented an EJB interface, EntityBean or
SessionBean and have Emacs jump in and also create the files for
the remote and home interfaces as well.

Even more extensive would be the ability for Emacs to create the
XML descriptor files, maybe an XAE like dialog with gui dropdowns
for the different choices based on the XML tags.

I modified a test XAE file and put in the dtd incantation that
Sun required.

  <!DOCTYPE ejb-jar PUBLIC
        "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
        "http://java.sun.com/dtd/ejb-jar_2_0.dtd";>

This url wasn't found, so I modified the last line to point to
the local dtd found in the unzipped version of the sdk:

  <!DOCTYPE ejb-jar PUBLIC
        "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
        "c:/java/j2sdkee1.3.1/lib/dtds/ejb-jar_2_0.dtd">

Then, I followed the menu items, DTD -> Parse DTD and vhalla, I had
dropdowns for the EJBs.  VERY, VERY, VERY, VERY, NICE Paul!

Here was what I did next.

Insert Element -> ejb-jar.  My file then contained;

<ejb-jar>
  <enterprise-beans>
  </enterprise-beans>
</ejb-jar>

Then, placing point in the middle of those tags, I did
Insert Element -> Entity Bean.  My file then contained;

<ejb-jar>
  <enterprise-beans>
    <entity>
      <ejb-name></ejb-name>
      <ejb-class></ejb-class>
      <persistence-type></persistence-type>
      <prim-key-class></prim-key-class>
      <reentrant></reentrant>
    </entity>
  </enterprise-beans>
</ejb-jar>

No matter what comes next, your XAE already supports the basis
for what we would need to make this thing a one-stop, one file
spawns the kitchen sink, EJB shopping environment.  Your packages
rock my Man!

So, now, starting from implementing an EntityBean in java code,
we could get the Remote, Home and XML Descriptors built
automagically.  For the XML descriptors, the <persistence-type>
and <reentrant> are the ones the user would need to enter (I'm
only studying this architecture for close future professional
coding, so I could be a bit off on the exact needs at this
point).  And, maybe the XAE could be hard-wired with the full
list of entries for the tags which need to be typed and the XAE
could be extended to make use of this list to prompt for the
correct entries, so the user would get no misspellings.

This would fit nicely with your prj.el structure, I'm sure.
Where the files should be saved, what naming conventions for the
files, ...

--
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.

Reply via email to