Hi,

having to implement a service which has an explicit constructor taking
two arguments, which are necessary for operation of the component, I
wonder whether we already have some kind of NotInitializedException.

That is, technically it is possible to create the component without
actually invoking its constructor, so that is something I have to care
for in the implementation. I would like to do so by throwing a dedicated
exception, which clearly states the problem, whenever some (non-trivial)
method is invoked before fully constructing the object.

I imagine something like the following:

/** is thrown when a component is attempted to be used before it was
    completely constructed.
*/
exception NotInitializedException : public Exception
{
};

- Do we already have something like this (perhaps not with this name,
  but with this semantics)?

- Does it make sense to put this into css.lang? I'd say so, since
  - this is where XInitialization resides
  - we're talking about a basic "UNO language" feature here, namely
    constructors

- Should this go into udkapi or offapi? I'd say the former (again for
  consistency with XInitialization)

- Strictly speaking, the thingie should be named
  NotConstructedException: The fact that service constructors are
  implemented using XInitialization is a mere abus^W implementation
  detail (which hopefully will change sooner or later). So, it might
  make sense to not refer to "init" in the exception name.

Opinions?

Thanks & Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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

Reply via email to