<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 7, 2009, at 1:16 PM, Jim Knutson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><p><tt>As Mike has mentioned, I also prefer platform consistency and if there's</tt><br> <tt>a problem with the platform view, we should fix it for the platform.</tt><br> <br> <tt>Let me throw out some potentials here:</tt><br> <br> <tt>* There is a general pattern existing in the platform today for sharing</tt><br> <tt>&nbsp; schemas across the technologies. &nbsp;Web services, servlets, ejbs, and I</tt><br> <tt>&nbsp; believe JCA Adapters all use this. &nbsp;Given that this metadata is likely</tt><br> <tt>&nbsp; to be shared across multiple technologies, it might be worth looking</tt><br> <tt>&nbsp; at reusing the platform schema sharing mechanism to encorporate the </tt><br> <tt>&nbsp; metadata into existing platform DDs. &nbsp;This further emphasises the </tt><br> <tt>&nbsp; fact that this spec. is using the existing platform component model</tt><br> <tt>&nbsp; to enhance it. &nbsp;</tt></p></div></blockquote><div>To be clear, the specifics that you're proposing are:</div><div><br></div><div>1. &lt;web-beans xmlns="<a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a>"></div><div><br></div><div>2. Import the &lt;ejb-ref>, &lt;message-ref>, etc. syntax into the web-beans.xml</div><div><br></div><div>For #1, it's important to remember that the official namespace has changed in almost every version of the JavaEE specs. &nbsp;So it's not accurate to say JavaEE has a history of consistent namespaces.</div><div><br></div><div>Long term, the reverse would be better, i.e. use the WebBeans namespace style instead of the older JavaEE style. &nbsp;For JavaEE, a big advantage would be making JavaEE configuration more modular and extensible. &nbsp;For example:</div><div><br></div><div>&nbsp;&nbsp;&lt;web-app xmlns="<a href="urn:java:javax.servlet">urn:java:javax.servlet</a>"&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:javaee="<a href="urn:java:javax.javaee">urn:java:javax.javaee</a>"</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:ejb="<a href="urn:java:javax.ejb">urn:java:javax.ejb</a>"</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:jms="<a href="urn:java:javax.jms">urn:java:javax.jms</a>"></div><div><br></div><div>&nbsp;&nbsp; &nbsp;&lt;javaee:resource-ref> ...</div><div>&nbsp;&nbsp; &nbsp;&lt;javaee:env-entry>...</div><div>&nbsp;&nbsp; &nbsp;&lt;ejb:ejb-ref> ...</div><div>&nbsp;&nbsp; &nbsp;&lt;jms:message-destination-ref> ...</div><div><br></div><div>&nbsp;&nbsp;&lt;/web-app></div><div><br></div><div>I'd love to see the above change happen in JavaEE 6 as a platform-wide, consistent, modular naming scheme.</div><div><br></div><div>For #2, if the modularity in #1 were adopted, then you'd solve #2 automatically. &nbsp;Otherwise, #2 is a bit odd, because those ejb-ref, message-ref, etc really should be designed as a layer on top of JavaEE IoC. &nbsp;The ejb-ref, etc should not be peers of WebBeans, they should be layered on top of it.</div><blockquote type="cite"><div><p><br> <tt>* The implication of the above doesn't preclude the use of a unique</tt><br> <tt>&nbsp; namespaces, but the default should probably be a platform namespace</tt><br> <tt>&nbsp; for the well known cases.</tt></p></div></blockquote><div>Somewhat. &nbsp;As in my example above, it would be even better if the shared JavaEE elements had their own namespace that didn't conflict with the servlet, ejb, jca, webbeans, etc namespaces. &nbsp;That change would clean up the entire platform and make it more modular, without losing any generality or power.</div><div><br></div><div>And, since the JavaEE namespace does change with each version, there's no real barrier to this proposal.</div><blockquote type="cite"><div><p><tt>* Any Java-XML mappings should not be defined by this spec. &nbsp;JAXB already</tt><br> <tt>&nbsp; covers appropriate Java-XML mappings and we shouldn't define anything</tt><br> <tt>&nbsp; different. &nbsp;It's a pain to do and get it right for all cases.</tt></p></div></blockquote><div>It would be a mistake to use JAXB, because JAXB is solving a different problem: general XML/Java serialization as opposed to XML configuration. &nbsp;A hammer is not appropriate for every task, and specifically, the semantics of configuration do not match the semantics of deserialization. &nbsp;No one is proposing that the XML configuration be a general Java deserialization specification. &nbsp;In this situation, the semantics are sufficiently different that each spec should focus on its core needs and not try to overgeneralize.</div><div><br></div><blockquote type="cite"><div><p><tt>I'm going to have to dig deeper to fully understand the metadata and</tt><br> <tt>Java-XML mappings, but I'm assuming the only real need for this is to</tt><br> <tt>incorporate extensibility into the XML instances for programmer defined</tt><br> <tt>stereotypes.</tt></p></div></blockquote><div>No, it's far bigger than that. &nbsp;It's central to the whole IoC concept and capabilities of the spec.</div><div><br></div><div>-- Scott</div><blockquote type="cite"><div><p><br> <tt><br> Thanks,<br> Jim Knutson<br> WebSphere J2EE Architect</tt><br> <br> <tt>Scott Ferguson &lt;<a href="mailto:ferg@caucho.com">ferg@caucho.com</a>> wrote on 12/21/2008 09:58:08 AM:<br> <br> > <br> > On Dec 20, 2008, at 10:12 PM, Gavin King wrote:<br> > <br> > > I would like to open up a discussion about the XML format defined in &nbsp;<br> > > chapter 10.<br> > ><br> > > Mike is concerned that the XML format is different to the style used<br> > > in other Java EE specifications, where class/method names are<br> > > generally specified as strings in the body of XML elements, and that<br> > > the XML format may turn out to be confusing to users.<br> > ><br> > > On the other hand, the format currently defined by the specification<br> > > is typesafe, allowing tooling to provide validation and<br> > > auto-completion of all class/method names, and is also less verbose.<br> > > It's also consistent with the approach used by existing solutions in<br> > > the spec (Spring, Seam).<br> > ><br> > > I've recently discovered that it's possible to write a Java 6<br> > > Processor that would generate the XML schema for a package containing<br> > > web beans as part of the compilation process. (This is an awesome new<br> > > feature of javac, that used to be provided by the APT plugin.)<br> > ><br> > > One possible path to take would be to use hyphenated names in the XML<br> > > (i.e. &lt;foo-bar> instead of &lt;FooBar>) to make the XML more visually<br> > > consistent with other EE descriptors.<br> > <br> > I love the new format. &nbsp;The <a href="urn:java:package">urn:java:package</a> namespace is brilliant, &nbsp;<br> > to the extent that I'd go postal if it reverted to the earlier draft. &nbsp; <br> > Among other advantages, it makes the XML so much more readable by &nbsp;<br> > emphasizing the bean's name. &nbsp;The name change to &lt;foo-bar> would be a &nbsp;<br> > good change, for consistency.<br> > <br> > Specifically, I just went through the process of changing our security &nbsp;<br> > tag/bean configuration to the new format, and the improvement is &nbsp;<br> > dramatic. &nbsp;With the new format, the XML expresses exactly what the &nbsp;<br> > configuration means, and with no extraneous verbiage. &nbsp;It's brilliant.<br> > <br> > There are a few things that I'd like tweaked, though:<br> > <br> > &nbsp; &nbsp;1) The inline bean vs property needs to be simplified. &nbsp;(9.5 &nbsp;<br> > injection point declarations), specifically the existence of a child &nbsp;<br> > element should not affect the parsing. &nbsp;Instead, it should follow the &nbsp;<br> > method model (9.2.6) where "has a direct child &lt;Initializer>, ..., or &nbsp;<br> > binding type." &nbsp;9.5 should be rewritten as:<br> > <br> > &nbsp; &nbsp; &nbsp; a) If the Java type is a parameterized type .... is a type &nbsp;<br> > declaration<br> > &nbsp; &nbsp; &nbsp; b) Otherwise if ... binding type ... is a type declaration<br> > &nbsp; &nbsp; &nbsp; c) Otherwise, the injection point declaration is an inline Web &nbsp;<br> > Bean declaration, and the declared type ...<br> > <br> > i.e. removing the old 3rd rule because it was making things more &nbsp;<br> > confusing. &nbsp;The slight extra verbosity by requiring &lt;Current/> for an &nbsp;<br> > injected type is outweighed by the simplification, and consistency &nbsp;<br> > with 9.2.6.<br> > <br> > The specific problem is: when does an XML element refer to a type and &nbsp;<br> > when does it refer to a bean to be instantiated (9.6 vs 9.7), which &nbsp;<br> > isn't obvious from the spec (it's well-defined, but can be simplified.)<br> > <br> > &nbsp; &nbsp;2) Property injection (bean-style setters) really need to be &nbsp;<br> > supported. &nbsp;The bean pattern is historic and embedded in essentially &nbsp;<br> > all specifications, so it's not really something WebBeans can avoid. &nbsp; <br> > Aside from the historic value, property injection lets you validate &nbsp;<br> > input easily at the configuration point, which is very nice.<br> > <br> > &nbsp; &nbsp;3) Argument vs field is somewhat visually confusing. &nbsp;The spec &nbsp;<br> > logic works, but it's easy to confuse a constructor arg for a field &nbsp;<br> > and waste time. &nbsp;I'm not sure it needs to be changed, but something to &nbsp;<br> > think about. &nbsp;You could have field/property as &lt;myapp:foo-bar> and &nbsp;<br> > types/annotations as &lt;myapp:FooBar> or add an &lt;arg> (I'm not sure &nbsp;<br> > these are good ideas or even if there needs to be a change. &nbsp;I'm just &nbsp;<br> > throwing the idea out.)<br> > <br> > &nbsp; &nbsp;4) Annotation declaration is great. &nbsp;I would like the ability to &nbsp;<br> > add non-webbeans annotations (for service declarations/introspection), &nbsp;<br> > but that non-critical and could certainly be put off until a later spec.<br> > <br> > -- Scott<br> > <br> > ><br> > ><br> > > I would like to get everyone's thoughts on this issue:<br> > ><br> > > Do you like the existing format?<br> > > Do you find it confusing? In what way?<br> > > Have you used this approach in Spring or Seam? If so, how did it &nbsp;<br> > > compare?<br> > > How important is typesafety?<br> > ><br> > > -- <br> > > Gavin King<br> > > <a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a><br> > > <a href="http://in.relation.to/Bloggers/Gavin">http://in.relation.to/Bloggers/Gavin</a><br> > > <a href="http://hibernate.org">http://hibernate.org</a><br> > > <a href="http://seamframework.org">http://seamframework.org</a><br> > ><br> > ><br> > <br> </tt></p></div></blockquote></div><br></body></html>