[jdom-interest] Why PartialList is non public and FilterList is public but final ???

Jools jools at jools.org
Tue Jun 26 10:00:11 PDT 2001


Markus Bernhardt wrote:
> 
> Jools wrote:
> 
> > > Got a problem.
> > > Need to override PartialList (or FilterList for future).
> >
> > Why ? What's your use case ?
> 
> I have written a set of event enabled jdom classes.
> Not DOM v3 compliant, but works fine.
> Now I have learned that PartialList or FilterList are
> live lists. Need to subclass them to fire events.

OK. I understand.
 
> >
> >
> > > Any reasons why they cant be subclassed.
> >
> > PartialList has plenty of problems as it is, subclassing it would
> > create more headaches than there are already (Try searching the
> > archives and you'll see what I mean !).
> >
> > FilterList is final (well it was the last time I checked it in)
> > because the behavior is modified by the Filters which are
> > assigned to the list.
> 
> I like this design with filter very much,
> but has it really to be final ?

The FilterList uses a Filter to decided what can be added/removed
and what items in the list are visible.

Given that all the operations that can be made to a list must all
be delegated to the filter assigned to the list, you could write
your own custom filters to fire off events as and when required.

The only problem that I can see is how your Filter would get 
propagated through the Document without a factory. 

If you have a more complete design, perhaps you could post it to 
the list.

--Jools



More information about the jdom-interest mailing list