We could add vendor specific elements (i.e. the ones found in jbosscmp-jdbc.xml) using namespaces.

I'll have to investigate if we could generate a different object model for each namespace.

But, altough it might be possible to do this, I wouldn't recommend it.

I would generate a different object model for each deployment descriptor: One object model for each Sun's standard XML Schema and one object model for each JBoss' deployment descriptor.

Maybe then we could write another object model to integrate both object models:

<made_up_code>

// This object was generated from j2ee-1.4.xsd:
EjbJar ejbJar = EjbJarFactory.create(standarDDFile);
String name = ejbJar.getEjbName();

// This object was generated from jboss-j2ee-1.4.xsd:
JBossEjbJar jbossJar =
   JBossEjbJarFactory.create(jbossDDFile);

// We could have a single object to integrate both object models:
EjbMetadata metadata =
    new EjbMetadata();

metadata.setStandarDeploymentDescriptor(ejbJar);
metadata.setJBossDeploymentDescriptor(jbossJar);

// We could then work with only one object model:
String name =
  metadata.getStandardDeploymentDescriptor().getName();

String jbossSpecificProperty =
  metadata.getJBossDeploymentDescriptor().getJBossSpecificProperty();

</made_up_code>

In conclusion:

1) We would generate the first object model using JAXB or XMLBeans, from Sun's XML Schema files.

2) We need to write XML Schemas for each JBoss vendor deployment descriptor.

3) We would generate the sencond object model from JBoss' XML Schema files.

4) We *could* integrate both object models coding another object model on top (no generation here). Then we could use this object model to access standard properties or JBoss' properties.

What do you think?

Ricardo Argüello

Alexey Loubyansky wrote:
Will we be able to have, say, entity related data from ejb-jar.xml, jboss.xml and jbosscmp-jdbc.xml in the same class? Or will we need three classes?

Ricardo Argüello wrote:

Alexey Loubyansky wrote:

Ricardo Argüello wrote:

Why not use JAXB, or BEA's XMLBeans?




Perhaps. But I don't have much of experience with JAXB and no at all with XMLBeans. So, maybe you can tell me why?



Because it will generate the complex object model specified in the J2EE Deployment Descriptors, in a very easy way.


For example, it would generate an object to represent <ejb-jar> ... </ejb-jar> from the EJB 2.1 deployment descriptor:

EjbJar ejbJar = EjbJarFactory.readFromFileSystem(deploymentDescriptorFile);
String name = ejbJar.getEjbName();
...


I have made up all this code, but is a good example of what you would expect from a XML/Java binding tool, as JAXB or XMLBeans.
Without having to write XML navigation/marshalling/unmarshalling code. A binding tool will generate all necesary Java files representing what's described in an XML Schema file, including validation.
We will have objets to refer to <web-app> ... </web-app>, <ejb-jar> ... </ejb-jar>, etc. with all complex relations between objets already coded.


And all these automaticaly generated from the official XML Schema files posted by Sun here:
http://java.sun.com/xml/ns/j2ee/


Think XDoclet... but for XML Schema files.... :-)


Since in J2EE 1.4 deployment descriptors are specified in XML Schema, it should be very easy to get an object model from that, using any XML/Java binding tool.




For example...



Sun's JAXB: http://java.sun.com/xml/jaxb/

BEA's XMLBeans:
http://dev2dev.bea.com/technologies/xmlbeans/

XMLBeans is very new, but more flexible than JAXB.
I have experience with JAXB, and none with XMLBeans, but it is basically the same thing...
We could try both and decide later.


Ricardo Argüello





------------------------------------------------------- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development






-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to