Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 59192 invoked from network); 23 Apr 2002 21:49:24 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 23 Apr 2002 21:49:24 -0000 Received: (qmail 17218 invoked by uid 97); 23 Apr 2002 21:49:28 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 17202 invoked by uid 97); 23 Apr 2002 21:49:28 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 17191 invoked from network); 23 Apr 2002 21:49:27 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [Collections][SUBMIT] TypedList Date: Tue, 23 Apr 2002 17:49:20 -0400 Message-ID: <66337F04F2A1E440BF87F2080B5F5370623DC0@madison.dc.Blackboard.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Collections][SUBMIT] TypedList Thread-Index: AcHrD2WjwjeW937uTAWTiQNa9+hAMQAATKZA From: "Tim Moore" To: "Jakarta Commons Developers List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I think the version using the Proxy pattern that you posted a few minutes ago is just as flexible and much easier to understand...just my $.02 :-) --=20 Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 > -----Original Message----- > From: Stephen Colebourne [mailto:scolebourne@eurobell.co.uk]=20 > Sent: Tuesday, April 23, 2002 5:47 PM > To: Jakarta Commons Developers List > Subject: Re: [Collections][SUBMIT] TypedList >=20 >=20 > OK, this is a different design to one using Predicate,=20 > although obviously a similar purpose. Before I can continue=20 > and finish the other collections, I would like a decision on=20 > which way to go ;-) >=20 > This design gives much more power, but is therefore more=20 > complex (more methods, more choice). Maybe there is a case=20 > for both. Maybe there is a case for wrapping a Predicate in a=20 > CollectionFilter. Not quite sure yet. >=20 > I would suggest the following interface is necessary to fully=20 > express the > possibilities: > public interface CollectionFilter { > // predicate > public boolean allowUpdate(Object obj, Collection coll); > // transform > public Object beforeUpdate(Object obj, Collection coll); > // info > public void afterUpdate(Object obj, Collection coll); >=20 > // predicate > public boolean allowGet(Object obj, Collection coll); > // info ??? > public void beforeGet(Object obj, Collection coll); > // transform > public Object afterGet(Object obj, Collection coll); >=20 > // predicate > public boolean allowRemove(Object obj, Collection coll); > // ??? > public Object beforeRemove(Object obj, Collection coll); > // ??? > public Object afterRemove(Object obj, Collection coll); > } >=20 > Hmm. Having sketched that out, I think I'm tending towards=20 > keeping it simple and sticking with PredicateList and=20 > TransformList. Views? I need guidance on this one before I=20 > can continue. >=20 > Stephen >=20 > From: Henri Yandell > > public interface CollectionFilter { > > > > public Object beforeAdd(Object obj, Collection coll); > > > > public Object beforeRemove(Object obj, Collection coll); > > public Object afterRemove(Object obj, Collection coll); > > > > } > > > > > > And same (ish) for Map? And then List/Set extend Collection=20 > filter and=20 > > add events? > > > > When something is added to the collection, it checks with=20 > beforeAdd,=20 > > passing the object and the collection. In TypedFilter it is set to=20 > > only allow Strings. It finds out the object isn't a String=20 > and returns=20 > > null? > > > > But does that mean return or insert null. Can we have an interface=20 > > that means both Predicate and Transform?? Or should they be=20 > separate. > > > > Hen > > > > > So we need something more than the existing Predicate/Transformer > classes > > > then? I think I need to go and code something to it working...=20 > > > Stephen -- To unsubscribe, e-mail: For additional commands, e-mail: