Frank Schönheit wrote:
Hi Stephan,


I'd prefer to stick with UnknownPropertyException here, for the reasons you already stated: UnknownPropertyException is already used in combination with attributes, namely to model optional attributes.


(is it? I did not find any such interface.)

The specification (DevGuide, 3.3.4) of this is out (and PropertySetMixin depends on it), even thought there might not be any uses yet in the OOo/URE UNO API.

Then we perhaps should think about re-using the
XPropertyChangeListener/PropertyChangeEvent, too, and just introduce a new
interface XAttributeChangeBroadcaster
{
  addPropertyChangeListener( [in] XPropertyChangeListener );
  removePropertyChangeListener( [in] XPropertyChangeListener );
};

...which has the drawback that no interface could inherit from both XPropertySet and XAttributeChangeBroadcaster (method name clashes), while demand for such inheritance would most probably arise (X1 has attributes and inherits XAttributeChangeBroadcaster, X2 inherits X1 and wants to offer the attributes as properties, and thus also inherits XPropertySet).

If we could find good, unambiguous names for the two methods of XAttributeChangeBroadcaster (aka XPropertyChangeBroadcaster), I am all for this solution (incl. the "carrying this further" below).

(the methods cannot be named *AttributeChangeListener, since I seem to
remember that some generic reflection services do not accept them as
valid listener concepts then - they only accept
"add/removeFooListener(XFooListener)", but not
"add/removeFooListener(XBarListener)".)

Carrying this further, we could rename XAttributeChangeBroadcaster to
XPropertyChangeBroadcaster and simply define that it might be used for
broadcasting attribute changes, too ....


(Besides, my current understanding of how exception mechanisms for programming environments should be designed tells me that the "checked" com.sun.star.beans.UnknownPropertyException and its use at com.sun.star.beans.XPropertySet.addPropertyChangeListener is a mistake. Hence, we should not make the situation worse by introducing a "checked" UnknownAttributeException as the next mistake).


What do you mean with "checked" here (Sorry if this question reveales my
ignorance :)

With "checked" I mean that it is not derived from com.sun.star.uno.RuntimeException, so maps to a checked Java exception in the Java UNO language binding. (And checked exceptions in the Java style are now considered bad design, at least in some circles...)

-Stephan

Turns out I did not look very thoroughly at your initial posting...


Ts ts. :)

Ciao
Frank

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

Reply via email to