[webbeans-dev] Re: XML configuration format

Gavin King gavin at hibernate.org
Thu Jan 8 21:46:13 EST 2009


On Fri, Jan 9, 2009 at 6:46 AM, Jim Knutson <knutson at us.ibm.com> wrote:

>> My IDE (Eclipse) automagically understands XML schema. There's no
>> configuration needed. Yes, I need to add the list of namespaces at the
>> top of my file but that's really not very difficult. I'm inclined to
>> think that pretty much everyone already knows how to do this. For one
>> thing, Spring uses the namespace-based approach, and a big chunk of EE
>> developers use Spring.
>
> I understand, but given that distinction, the EE DDs follow the same
> pattern and rules and get just as much help from the IDE.  You still
> get content assist with documentation, etc.  However, once you start
> creating new schemas and they aren't served by an internet location,
> you need to start managing your XML Catalog so the schemas for those
> new namespaces can be found.

Yes, this is a point. It's true that XML editor needs to be aware of
where javac will generate the schemas too. This was the feedback I had
from Max Anderson who does our tooling.

So what I proposed in a previous thread is that there will be a
well-defined location where the XML schema for a package would live
(i.e. in the classpath, right next to the classes in that package),
and that the tooling could then be smart enough to know that the
namespace "urn:java:org.jboss.whatever" would be in the classpath at
/org/jboss/whatever/schema.xsd, relieving the user from having to
worry about configuring the catalog.

Of course, for pre-packaged libraries, the main usecase, the schema
could also be loaded from the internet URL in the usual fashion, which
also requires no special configuration.


>> And the point is that the new-style XML gives you context assist and
>> validation for much more stuff than the old-style XML. With the old
>> style XML you get content assist for <class> and <method>, elements
>> that simply don't exist in the new-style XML! The old-style doesn't
>> help you at all when you start typing the actual class and method
>> names - which are more or less the *only* things you need to type in
>> the new-style XML (where they *can* be autocompleted).
>
> Ok, so what you are attempting to do is turn semantic content into
> syntax.  I understand how this can help in some cases, but not all
> (e.g. defining method sets),

What is a "method set"?


> but I think that's beside the point.
> The point is that there's a platform pattern.  To integrate with the
> platform, I think you need to conform to the platform pattern.  If
> you don't like the platform pattern, then the entire pattern ought
> to be consistently changed, not just one portion of it.

Jim, this doesn't seem right to me.

"Platform patterns" begin somewhere. A pattern is first introduced in
one spec, and people notice that the pattern is useful and has a wider
range of usefulness, and then they start to reuse the pattern in other
places in the platform.

Take annotations, for example.

Annotations were first trialed in the EJB spec and in the WS stuff in
Java EE 5. They were not supported in the servlet spec, the JSF spec
or anywhere else!

Someone could have reasonably raised the objection during Java EE 5
that the use of annotations in EJB3 was inconsistent with the
"platform pattern" for specifying metadata.

Now, in EE 6, we can see that annotations were hugely successful, so
we're going back and retrofitting them where they were missing.

I don't see why we can't follow the same path here.


>> It's certainly true that the vast majority of developers don't
>> *define* schemas, but the whole point of this is that they don't need
>> to in web beans either: the schema can be generated by javac.
>
> Except for the fact that it IS new schema and they must be aware of
> it and the impact on the content.
>
> Anyway, my point remains that platform consistency needs to be maintained
> or we will lose the concept of a platform and degenerate into a bunch
> of piece parts.  If we can get the platform to move to a more modern
> XML style, I'm ok with that too.  I just want integrated consistency.

I would *love* to see the EJB spec adopt this XML style as soon as
possible, partly because ejb-jar.xml is just such a pain.

I don't think that the other EE DDs are urgent.

-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list