Difference between revisions of "User:Frank Schönheit/Changing API incompatibly"
From Apache OpenOffice Wiki
| Line 14: | Line 14: | ||
* [http://api.openoffice.org/docs/common/ref/com/sun/star/text/FontRelief.html css.text.FontRelief] and [http://api.openoffice.org/docs/common/ref/com/sun/star/awt/FontRelief.html css.awt.FontRelief] should be consolidated | * [http://api.openoffice.org/docs/common/ref/com/sun/star/text/FontRelief.html css.text.FontRelief] and [http://api.openoffice.org/docs/common/ref/com/sun/star/awt/FontRelief.html css.awt.FontRelief] should be consolidated | ||
* [http://api.openoffice.org/docs/common/ref/com/sun/star/form/XDatabaseParameterBroadcaster2.html XDatabaseParameterBroadcaster2] should replace [http://api.openoffice.org/docs/common/ref/com/sun/star/form/XDatabaseParameterBroadcaster.html XDatabaseParameterBroadcaster] | * [http://api.openoffice.org/docs/common/ref/com/sun/star/form/XDatabaseParameterBroadcaster2.html XDatabaseParameterBroadcaster2] should replace [http://api.openoffice.org/docs/common/ref/com/sun/star/form/XDatabaseParameterBroadcaster.html XDatabaseParameterBroadcaster] | ||
| + | * [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbcx/XColumnsSupplier.html#getColumns XColumnsSupplier.html::getColumns] should be allowed to raise an <code>SQLException</code> | ||
=== Exception declarations === | === Exception declarations === | ||
Revision as of 12:33, 2 November 2009
That's just my personal list of UNO APIs I would like to change incompatibly, if we are ever allowed to. Note there's much more than this. I just can't remember at the moment, but when working with API, I regularily encounter things which now will hopefully appear here over time.
various
- XRowSetSupplier:
setRowSetshould be allowed to throw a NoSupportException - There should be an interface merging XRow and XResultSet. Both are nearly always used together, and having to work with two interfaces, one for navigating through the result set, and one for querying the actual values, sucks.
- XContent should have direct access to selected properties. Asking for a given property by executing a command named
getPropertyValues, which returns aXRow/XResultSet, through which you need to navigate, is absolutely ridiculous. - various XDatabaseMetaData methods should take
anys instead of strings. For instance, getTables should take ananyfor the schemaPattern, whereNULLindicates "all schemas", as in JDBC. - XPropertyContainer::addProperty should allow for
NULLdefaults, by separating between the type of a property, and its default. - XSet should allow for for non-mutable implementations, by throwing a NoSupportException at the insert/remove method. For consistency reasons, this should then probably be extended to all container interfaces.
- XFilter::filter definitely needs to allow for more than a
RuntimeException. At least aWrappedtTargetExceptionis mandatory here. - DoubleInitializationException and AlreadyInitializedException save the same purpose, so they should be consolidated into one exception class. And of course this new class should not reside in module
ucborframe, but in some generic module (util?lang?beans?). Probably, XInitialization::initialize should throw this exception then. XInteractionHandler::handleshould return a boolean, which indicates whether the given request could be handled. This would allow clients to fall back to other means of user-notification. In the current form, you must know which exceptions are handled by the interaction handler, and this knowledge can be out of date over time. Alternatively, you can add a confirmation continuation to the request, and assume that if no continuation, not even this one, has been selected, then the handler couldn't handle the request - which is an error-prone heuristics, too.- css.text.FontRelief and css.awt.FontRelief should be consolidated
- XDatabaseParameterBroadcaster2 should replace XDatabaseParameterBroadcaster
- XColumnsSupplier.html::getColumns should be allowed to raise an
SQLException
Exception declarations
- XFilter::filter should be allowed to throw exceptions (
InvalidArgument,InsufficentArguments, or the like) XStorable::storeand friends should allow for aWrappedTargetException. This would allow implementations to wrap e.g. theInteractiveAugmentedIOExceptionwhich can be thrown by usual UCB methods.