You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Szegedi Attila <sz...@freemail.hu> on 2001/08/01 16:58:50 UTC

RE: Creative criticism on Anakia design

All done.

In detail, I have:

- Transfered most of AnakiaTask.java content into AnakiaBaseTask.java and
made it abstract with an abstract method named populateContext(). Also,
moved the logic for determining output encoding into a protected method
accessible to subclasses.

- Rewritten AnakiaTask.java to subclass from AnakiaBaseTask and implement
populateContext() in a fashion compatible with previous AnakiaTask.

- Added Anakia2Task.java that subclasses AnakiaBaseTask and implements
populateContext() so that it places single-element NodeLists of Documents as
$root and $project in the context.

- Added NodeList.java as a support class for Anakia2Task

- Modified xdocs/anakia.xml to mention there are two "flavors" of Anakia now
and provide a separate section for describing the context objects of Anakia2
and differences to original Anakia. I didn't made a separate xdocs page as
there is much in common in the two versions (all parameters of the task,
introducing of the taskdef into the ant buildfile, etc.)

- For convenience, rebuilt docs/anakia.html

However, I don't want to burden the mailing list with a 28 kbytes
attachment. Should I send the files to you, Jon?



Cheers,

  Attila.





> -----Original Message-----

> From: Jon Stevens [mailto:jon@latchkey.com]

> Sent: Wednesday, August 01, 2001 3:47 AM

> To: velocity-user

> Subject: Re: Creative criticism on Anakia design

[...]

> If you are really interested in seeing this class applied to

> CVS, you are

> going to have to do the rest of the work to make it happen (I

> really don't

> have time right now).

>

> My suggestions:

>

> #1. Factor the core of Anakia.java into a base class which

> people can extend

> to add their own functionality on top of. Keep the

> Anakia.java functionality

> the same and have it extend the base class.

>

> #2. Create an AnakiaNodeList.java which extends the base

> class and which

> people can refer to directly in their Ant build.xml files and

> implements

> your new functionality without breaking the existing functionality.

>

> #3. Create another xdoc which documents this new functionality.

>

> Anakia hasn't had much innovation added to it since it was

> released. I look

> forward to your further patches and contributions.

>

> Thanks!

>

> -jon

>

>



Re: Creative criticism on Anakia design

Posted by Jon Stevens <jo...@latchkey.com>.
on 8/2/01 12:36 AM, "Szegedi Attila" <sz...@freemail.hu> wrote:

> I gave some more thinking to Anakia redesigning yesterday, and I thought
> it's just not elegant  the way I originally made it. I SHOULD be able to
> preserve backward compatibility. Finally, I figured out how could I
> incorporate the new functionality WITHOUT losing backward compatibility.
> Basically, I'll subclass the org.jdom.Element to have applyXPath() and
> toString() implemented to behave identically to a single-element NodeList,
> and make a custom JDOMFactory for it, then plug that factory into the
> SAXBuilder used by Anakia. I'll also tweak TreeWalker and XPathTool to
> return NodeList (it implements java.util.List as well, so it's backward
> compatible).
> 
> This way, the new functionality becomes a feature of Element and everything
> is backward compatible. There is no need for two different Anakias! Be back
> soon after I'm done.
> 
> Attila.

Kick ass!

-jon


Re: Creative criticism on Anakia design

Posted by Szegedi Attila <sz...@freemail.hu>.
I gave some more thinking to Anakia redesigning yesterday, and I thought
it's just not elegant  the way I originally made it. I SHOULD be able to
preserve backward compatibility. Finally, I figured out how could I
incorporate the new functionality WITHOUT losing backward compatibility.
Basically, I'll subclass the org.jdom.Element to have applyXPath() and
toString() implemented to behave identically to a single-element NodeList,
and make a custom JDOMFactory for it, then plug that factory into the
SAXBuilder used by Anakia. I'll also tweak TreeWalker and XPathTool to
return NodeList (it implements java.util.List as well, so it's backward
compatible).

This way, the new functionality becomes a feature of Element and everything
is backward compatible. There is no need for two different Anakias! Be back
soon after I'm done.

Attila.


----- Original Message -----
From: "Jon Stevens" <jo...@latchkey.com>
To: "velocity-dev" <ve...@jakarta.apache.org>
Sent: 2001. augusztus 1. 17:09
Subject: Re: Creative criticism on Anakia design


> on 8/1/01 7:58 AM, "Szegedi Attila" <sz...@freemail.hu> wrote:
>
> > However, I don't want to burden the mailing list with a 28 kbytes
> > attachment. Should I send the files to you, Jon?
> >
> > Cheers,
> >
> > Attila.
>
> Sounds good. The only thing that I'm not "happy" about is that it is
> Anakia2Task.java. I would rather it just be AnakiaNodeListTask.java
>
> Thanks!
>
> -jon
>
>


Re: Creative criticism on Anakia design

Posted by Szegedi Attila <sz...@freemail.hu>.
Ok, I'll change that "2" into "NodeList". However, I'll leave that to
tomorrow (it's fairly late afternoon here in Hungary now, and I ought to
take my kid to the playground...)

Cheers,
  Attila.

----- Original Message -----
From: "Jon Stevens" <jo...@latchkey.com>
To: "velocity-dev" <ve...@jakarta.apache.org>
Sent: 2001. augusztus 1. 17:09
Subject: Re: Creative criticism on Anakia design


> on 8/1/01 7:58 AM, "Szegedi Attila" <sz...@freemail.hu> wrote:
>
> > However, I don't want to burden the mailing list with a 28 kbytes
> > attachment. Should I send the files to you, Jon?
> >
> > Cheers,
> >
> > Attila.
>
> Sounds good. The only thing that I'm not "happy" about is that it is
> Anakia2Task.java. I would rather it just be AnakiaNodeListTask.java
>
> Thanks!
>
> -jon
>
>


Re: Creative criticism on Anakia design

Posted by Jon Stevens <jo...@latchkey.com>.
on 8/1/01 7:58 AM, "Szegedi Attila" <sz...@freemail.hu> wrote:

> However, I don't want to burden the mailing list with a 28 kbytes
> attachment. Should I send the files to you, Jon?
> 
> Cheers,
> 
> Attila.

Sounds good. The only thing that I'm not "happy" about is that it is
Anakia2Task.java. I would rather it just be AnakiaNodeListTask.java

Thanks!

-jon