You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by David Zejda <dv...@atlas.cz> on 2004/08/10 19:31:39 UTC

[COLLECTIONS] apprising and aware (proposal)

Commons Collections (CCs) is a quite nice bunch of code. As examining 
avilable classes and interafaces, I noticed that most of collection 
variations I developed during years are present there, so possibly I'll 
upgrade some of my current projects to be using CCs instead of my 
proprietary ones.

The only bigger thing I'm missing in CCs are my "apprising" collections 
and related utility classes. The main idea behind them is to have the 
data structure able to serve listeners about internal changes, esp. adds 
and removals.

public interface ItemMovedSource
{
     public void addItemMovedListener(ItemMovedListener listener);
     public void removeItemMovedListener(ItemMovedListener listener);
}

public interface ApprisingCollection extends ItemMovedSource, ...
{
}

I also created the exteded versions of "apprisings", called "aware". 
They are able to report the property changes inside imbedded objects 
that implements the ProperyChangeSource interface.

public interface PropertyChangeSource
{
     public void addPropertyChangeListener(PropertyChangeListener 
listener);
     public void removePropertyChangeListener(PropertyChangeListener 
listener);
}

public interface AwareCollection extends ApprisingCollection, 
PropertyChangeSource
{
}

Apprising collection could be easily chained to get more functionality 
(e.g. filtering, sorting...) without restrictions on mutability of the 
backed collection - adds/removals are propagated in both directions.

What do you think? Would be such contribution (after several tunings to 
accomodate Jakarta & CCs conventions and style) to CCs desirable?

Regards
David Zejda

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [COLLECTIONS] apprising and aware (proposal)

Posted by Stephen Colebourne <sc...@btopenworld.com>.
Could you take a look at [events] in the commons sandbox? This is a split
off from [collections] intended to provide event generating wrappers for
collections. It never got finished, partly due to different design
proposals, but you code may dovetail in there.

FYI, as a general rule I am trying to minimise larger additions to
[collections] itself now, as the project has reached a certain size. Thus
new, more independent ideas (events/primitives) are being pushed to their
own projects.

Stephen


----- Original Message -----
From: "David Zejda" <dv...@atlas.cz>
> Commons Collections (CCs) is a quite nice bunch of code. As examining
> avilable classes and interafaces, I noticed that most of collection
> variations I developed during years are present there, so possibly I'll
> upgrade some of my current projects to be using CCs instead of my
> proprietary ones.
>
> The only bigger thing I'm missing in CCs are my "apprising" collections
> and related utility classes. The main idea behind them is to have the
> data structure able to serve listeners about internal changes, esp. adds
> and removals.
>
> public interface ItemMovedSource
> {
>      public void addItemMovedListener(ItemMovedListener listener);
>      public void removeItemMovedListener(ItemMovedListener listener);
> }
>
> public interface ApprisingCollection extends ItemMovedSource, ...
> {
> }
>
> I also created the exteded versions of "apprisings", called "aware".
> They are able to report the property changes inside imbedded objects
> that implements the ProperyChangeSource interface.
>
> public interface PropertyChangeSource
> {
>      public void addPropertyChangeListener(PropertyChangeListener
> listener);
>      public void removePropertyChangeListener(PropertyChangeListener
> listener);
> }
>
> public interface AwareCollection extends ApprisingCollection,
> PropertyChangeSource
> {
> }
>
> Apprising collection could be easily chained to get more functionality
> (e.g. filtering, sorting...) without restrictions on mutability of the
> backed collection - adds/removals are propagated in both directions.
>
> What do you think? Would be such contribution (after several tunings to
> accomodate Jakarta & CCs conventions and style) to CCs desirable?
>
> Regards
> David Zejda
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org