cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianugo Rabellino <>
Subject Re: DirectoryGenerator using abstract Source
Date Fri, 15 Jul 2005 08:29:03 GMT
On 7/14/05, Daniel Fagerstrom <> wrote:

> I don't think it is a good idea to deprecate things that have been
> arround in Cocoon from the very beginning and is part of about every
> book, tutorial and article that have been written about Cocoon.

I can clearly see your point. Being DG so much part of core Cocoon,
it's tough stuff to handle. However, it's also very clear how much TG
is more flexible: if you consider that a guy like Michi, a Cocoon and
Lenya committer, was unaware of its existence, you'll realize how
we're doing a very bad job in promoting our stuff, and how having
"old" stuff lying around stops the way to evolution and might become a
maintenance nightmare.
> If they where considered harmfull in some way, hard to maintain or was
> in the way for developing new important stuff I would agree in
> deprecating them. But I don't see that it is the case.

Could well be. DG is solid stuff indeed, much like XSP who have been
there almost forever with little to no need for maintainance.

> A much better way to handle old stuff where we have found better ways of
> achieving what they are intended for is IMO doing like we did for XSP,
> remove it from core and move it to a block.
> For the DirectoryGenerator we could have a certain DirectoryGenerator
> block, or put it together with some other "obsololete" stuff that belong
> together in some way in a block. Or we could have an
> "backcompability2.1" block, with everything that we find old fashoned
> and want to move away from core.

I like that. It would be a nice way of migrating stuff. However, to
make it happen, we should make sure first that TG does everything DG
and relatives can do (images, Mp3, etc...).

> >In any case, avoid "extends" like the plague. If anything, the hassle
> >we're going to have because of that bunch of generators extending DG
> >should prove how extends can be harmful.
> >
> I don't follow you here, care to expand on it?

It's just the old fart of favoring composition over inheritance. This
stuff (taken from o.a.c.generation.ImageDirectoryGenerator) smells
Fragile Base Class:

    protected void setNodeAttributes(File path) throws SAXException {

(wherever I see super(), I tend to frown :-)). I'd much rather see a
different pattern based on source descriptors and inspectors, much
like what has been done in the repository block with
InspectableSource, SourceDescriptor and SourceInspector.

Gianugo Rabellino
Pro-netics s.r.l. -
Orixo, the XML business alliance:
(blogging at

View raw message