Frank Schönheit - Sun Microsystems Germany wrote:
Hello Rainman,
We are developing our products upon UNO component model.
One of the big problem we have met is how to implement a service which
declared by the NEW STYLE statement.
...
Now the problem comes, this is a terrible multiple inheritance
relationship in C++, and maks hardly reuse of ImplA. because of ImplA
and XB both derived from XA,
leading that we must implement all methods declared in XA within ImplB
again.The same problem occurs in ImplC.
If there are many methods in XA, the development and the maintenance
complexity of the ImplB and ImplC would be unacceptable.
This in fact is a big problem, IMO.
Upon continued begging the skeletonmaker tool (which is part of the SDK)
is meanwhile able to generate code for you which does the forwarding
(the concrete syntax evades me at the moment), which somewhat relaxes
the problem.
However, very high on my personal wishlist would be a define,
auto-generated into XFoo.hpp, which allows me to write something like
FORWARD_XFOO( <base_class_name> )
, which effectively implements all methods of XFoo, just forwarding them
to "base_class_name". This would reduce the maintenance efforts to mere
re-compilation.
(And while we are at it, an
DECLARE_XFOO()
would be great, too, also coming from the .hpp file. Yes, I know that
skeletonmaker can also generate all the member declarations, but that's
again a maintenance problem if the interface changes, which happens
often enough during development of new API.)
hmm... isn't that pretty much why ImplInheritanceHelper exists?
http://api.openoffice.org/docs/cpp/ref/names/cppu/c-ImplInheritanceHelper1.html
or am i missing something here?
(well, i guess you still have to override XServiceInfo by hand...)
michael
--
"The last good thing written in C was
Franz Schubert's Symphony number 9." -- Erwin Dieterich
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]