commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [collections] CollectionDelegate
Date Mon, 18 Aug 2003 23:45:08 GMT
You will find classes like this already on the CVS in [collections]
decorator subpackage, named Abstract*.

Note that they have not yet been released.

Stephen

----- Original Message -----
From: "Takuya Murata" <takusi@manjiro.net>
> Hello, everyone. I am new to here.
>
> I have some Java classes I think it is nice that commons include. They
> are classes acting like AbstractCollection but actual implementation
> can be done in places other than its superclass.
>
> Client code looks like:
>
> public class Menu extends CollectionDelegate {
>    private MenuImp imp;
>
>    private Menu (MenuImp imp) {
>      super (imp.collection ());
>      this.imp = imp;
>    }
>
>    public Menu () {
>      Menu (Util.getMenuImp ());
>    }
> }
>
> As you see, collection is defined in somewhere and the implementation
> is acquired through imp.collection ().
>
> The implementation of CollectionDelegate is simple and straightforward;
> as the name says, all methods defined in Collection interface is
> forwarded into
>
> Likewise, ListCollection and similar delegate corresponding each
> collection interface should defined as well.
>
> Hope this proposal sounds useful.
>
> Takuya Murata
> takusi@manjiro.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


Mime
View raw message