<html><body>
<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><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><br>
<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><br>
<br>
<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>encorporate extensibility into the XML instances for programmer defined</tt><br>
<tt>stereotypes.</tt><br>
<tt><br>
Thanks,<br>
Jim Knutson<br>
WebSphere J2EE Architect</tt><br>
<br>
<tt>Scott Ferguson &lt;ferg@caucho.com&gt; wrote on 12/21/2008 09:58:08 AM:<br>
<br>
&gt; <br>
&gt; On Dec 20, 2008, at 10:12 PM, Gavin King wrote:<br>
&gt; <br>
&gt; &gt; I would like to open up a discussion about the XML format defined in &nbsp;<br>
&gt; &gt; chapter 10.<br>
&gt; &gt;<br>
&gt; &gt; Mike is concerned that the XML format is different to the style used<br>
&gt; &gt; in other Java EE specifications, where class/method names are<br>
&gt; &gt; generally specified as strings in the body of XML elements, and that<br>
&gt; &gt; the XML format may turn out to be confusing to users.<br>
&gt; &gt;<br>
&gt; &gt; On the other hand, the format currently defined by the specification<br>
&gt; &gt; is typesafe, allowing tooling to provide validation and<br>
&gt; &gt; auto-completion of all class/method names, and is also less verbose.<br>
&gt; &gt; It's also consistent with the approach used by existing solutions in<br>
&gt; &gt; the spec (Spring, Seam).<br>
&gt; &gt;<br>
&gt; &gt; I've recently discovered that it's possible to write a Java 6<br>
&gt; &gt; Processor that would generate the XML schema for a package containing<br>
&gt; &gt; web beans as part of the compilation process. (This is an awesome new<br>
&gt; &gt; feature of javac, that used to be provided by the APT plugin.)<br>
&gt; &gt;<br>
&gt; &gt; One possible path to take would be to use hyphenated names in the XML<br>
&gt; &gt; (i.e. &lt;foo-bar&gt; instead of &lt;FooBar&gt;) to make the XML more visually<br>
&gt; &gt; consistent with other EE descriptors.<br>
&gt; <br>
&gt; I love the new format. &nbsp;The urn:java:package namespace is brilliant, &nbsp;<br>
&gt; to the extent that I'd go postal if it reverted to the earlier draft. &nbsp; <br>
&gt; Among other advantages, it makes the XML so much more readable by &nbsp;<br>
&gt; emphasizing the bean's name. &nbsp;The name change to &lt;foo-bar&gt; would be a &nbsp;<br>
&gt; good change, for consistency.<br>
&gt; <br>
&gt; Specifically, I just went through the process of changing our security &nbsp;<br>
&gt; tag/bean configuration to the new format, and the improvement is &nbsp;<br>
&gt; dramatic. &nbsp;With the new format, the XML expresses exactly what the &nbsp;<br>
&gt; configuration means, and with no extraneous verbiage. &nbsp;It's brilliant.<br>
&gt; <br>
&gt; There are a few things that I'd like tweaked, though:<br>
&gt; <br>
&gt; &nbsp; &nbsp;1) The inline bean vs property needs to be simplified. &nbsp;(9.5 &nbsp;<br>
&gt; injection point declarations), specifically the existence of a child &nbsp;<br>
&gt; element should not affect the parsing. &nbsp;Instead, it should follow the &nbsp;<br>
&gt; method model (9.2.6) where &quot;has a direct child &lt;Initializer&gt;, ..., or &nbsp;<br>
&gt; binding type.&quot; &nbsp;9.5 should be rewritten as:<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; a) If the Java type is a parameterized type .... is a type &nbsp;<br>
&gt; declaration<br>
&gt; &nbsp; &nbsp; &nbsp; b) Otherwise if ... binding type ... is a type declaration<br>
&gt; &nbsp; &nbsp; &nbsp; c) Otherwise, the injection point declaration is an inline Web &nbsp;<br>
&gt; Bean declaration, and the declared type ...<br>
&gt; <br>
&gt; i.e. removing the old 3rd rule because it was making things more &nbsp;<br>
&gt; confusing. &nbsp;The slight extra verbosity by requiring &lt;Current/&gt; for an &nbsp;<br>
&gt; injected type is outweighed by the simplification, and consistency &nbsp;<br>
&gt; with 9.2.6.<br>
&gt; <br>
&gt; The specific problem is: when does an XML element refer to a type and &nbsp;<br>
&gt; when does it refer to a bean to be instantiated (9.6 vs 9.7), which &nbsp;<br>
&gt; isn't obvious from the spec (it's well-defined, but can be simplified.)<br>
&gt; <br>
&gt; &nbsp; &nbsp;2) Property injection (bean-style setters) really need to be &nbsp;<br>
&gt; supported. &nbsp;The bean pattern is historic and embedded in essentially &nbsp;<br>
&gt; all specifications, so it's not really something WebBeans can avoid. &nbsp; <br>
&gt; Aside from the historic value, property injection lets you validate &nbsp;<br>
&gt; input easily at the configuration point, which is very nice.<br>
&gt; <br>
&gt; &nbsp; &nbsp;3) Argument vs field is somewhat visually confusing. &nbsp;The spec &nbsp;<br>
&gt; logic works, but it's easy to confuse a constructor arg for a field &nbsp;<br>
&gt; and waste time. &nbsp;I'm not sure it needs to be changed, but something to &nbsp;<br>
&gt; think about. &nbsp;You could have field/property as &lt;myapp:foo-bar&gt; and &nbsp;<br>
&gt; types/annotations as &lt;myapp:FooBar&gt; or add an &lt;arg&gt; (I'm not sure &nbsp;<br>
&gt; these are good ideas or even if there needs to be a change. &nbsp;I'm just &nbsp;<br>
&gt; throwing the idea out.)<br>
&gt; <br>
&gt; &nbsp; &nbsp;4) Annotation declaration is great. &nbsp;I would like the ability to &nbsp;<br>
&gt; add non-webbeans annotations (for service declarations/introspection), &nbsp;<br>
&gt; but that non-critical and could certainly be put off until a later spec.<br>
&gt; <br>
&gt; -- Scott<br>
&gt; <br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; I would like to get everyone's thoughts on this issue:<br>
&gt; &gt;<br>
&gt; &gt; Do you like the existing format?<br>
&gt; &gt; Do you find it confusing? In what way?<br>
&gt; &gt; Have you used this approach in Spring or Seam? If so, how did it &nbsp;<br>
&gt; &gt; compare?<br>
&gt; &gt; How important is typesafety?<br>
&gt; &gt;<br>
&gt; &gt; -- <br>
&gt; &gt; Gavin King<br>
&gt; &gt; gavin.king@gmail.com<br>
&gt; &gt; <a href="http://in.relation.to/Bloggers/Gavin">http://in.relation.to/Bloggers/Gavin</a><br>
&gt; &gt; <a href="http://hibernate.org">http://hibernate.org</a><br>
&gt; &gt; <a href="http://seamframework.org">http://seamframework.org</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; <br>
</tt></body></html>