On Thu, 14 Aug 2003, Stephen Colebourne wrote:

> <snip>
>
> The biggest problem with all this is that the collection returned by
> getSource() on the event. If the observed collection is wrapped (eg. by a
> SyncronizedCollection) then getSource() SHOULD return the wrapped
> collection, but it can't as it doesn't know about it. This problem applies
> to all designs so far.

Is this also a problem?  It's general to all of the delegation
implementations.


 private boolean heardChange = false;

 public void testChangeToBackingCollection()
 {
  Collection c = new ArrayList();
  ObservableCollection oc = CollectionUtils.observableCollection(c);
  oc.addListener(new CollectionListener()
   {
    public void changed(CollectionEvent e) { heardChange = true; }
   });

  c.add("hello");

  assertTrue("heardChange == true", heardChange == true);
 }


I don't think it's possible to make this test pass -- just a
shortcoming of the wrapper design.  That's why I was looking into
aspect-based implementations.

   michael


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to