Peter Donald
Sat, 02 Feb 2002 00:58:21 -0800
On Sat, 2 Feb 2002 19:30, Paul Hammant wrote:
> Peter,
>
> >Hi,
> >
> >Okay I got bored and didn't wait for your patch ;)
>
> Me? Sorry dude. I was actually thinking about it and had poked around
> in src.
Alexis actually - but I would have accepted patches from anywhere ;)
> A neat solution that allows SAX/DOM to sort it out.
yep thats what I though and it also is a lot less confusing to people already
familiar with XML aswell ;)
> I was thinking of a solution that worked at Sar construction stage.
> Some form of Ant task that would make a config.xml from constituent parts:
>
> <xmlcombine dest="build/conf/config.xml">
> <fileset> ..... </fileset>
> </xmlcombine>
>
> It could be reused for assembly.xml etc. Or even for ejb-jar.xml ( or
> Beans.xml for EOB )
On a related note you should check out xdoclet.sourceforge.org - it looks to
be an absolute fantastic tool with a very good chance of filling a big hole
in java land.
Basically it allows you to add in special tags to the javadoc of your class
and it can suck them out and generate things for them. For instance hopefully
all the ant documentation and descriptors will in the future use these tags.
I also plan to eventually add the ability to do similar things for Blocks (ie
generate blockinfo files, template config files etc). Currently xdoclet is
mainly focused on EJB stuff and generating all the descriptors for different
containers but it can easily be changed to do almost any meta-data needs.
I really think that xdoclet if it gets enough publicity will be the next ant
or junit - ie something that almost everyone uses once they have tried it.
Still has some growing pains to go through but pretty good none the less.
So to generate an xml descriptor you would comment your block something like
/**
*
* @phoenix:version 2.0
* @phoenix:service com.biz.foo.MyService
*/
class MyBlock implement MyService
{
...
/**
*
* @phoenix:dependecy com.biz.foo.MyDependency
* @phoenix:dependecy com.biz.foo.MyOtherDependency
*/
public void compose( ComponentManager componentManager )
{
...
}
...
}
and it would automagically generate the descriptor when you compile. You
could also use the xdoclet to generate the other descriptors to some degree
or another and maybe even generate some glue code.
Anyways haven't even looked at it properly yet but it would definetly be a
good direction to head in the future.
--
Cheers,
Pete
When a stupid man is doing something he's ashamed of, he always
declares that it is his duty.
George Bernard Shaw
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>