Bernd Eilers wrote:
>
> Hi there!
>
> In the context of the recent discussion on how a more
"javaish" UNO java
> language binding and API could look like I would like
to present the
> idea of using annotations to develop UNO components in
java.
>
>
> Java API for XML Web Services (JAX-WS)
> http:
//java.sun.com/webservices/jaxws/index.jsp
>
> the newly rearchitected API stack for Web services
which is part of
> project glassfish and will be included in Java SE 6
offers a very nice
> method to develop Web Services by using the java
annotation mechanism
> introduced in Java SE 5 and special ant tasks.
>
> Basically what you can do is to write an
MyWebServiceImpl.java
> Implemenation class for your WebService where you do
need to know almost
> nothing about how webservices work at all and add a
line "import
> javax.jws.WebService" and a line " WebService" to it and than create a
> ant task in your build.xml which calls the java apt
utility to generate
> a derived class that adds all the stuff needed to
integrate a service
> into the web services framework, generates a WSDL file
from the java
> class etc.
>
> I was wondering if something similar could be done for
UNO Services to
> be developed in java.
>
> That would mean that when a developer wants to create a
simple UNO
> service ::com::mycompany::openoffice::MyService he/she
would not need to
> know that much about UNO and it´s IDL language etc. but
could just
> create a MyServiceImpl.java source code in package
> com.mycompany.openoffice which would be using some
special annotations
> and than we´d have apt working on that (via apt ant
task) generating a
> derived class providing all that XServiceInfo stuff
etc. needed by UNO
> services, generating an IDL file from the java source,
generating type
> registry information etc. automatically and so on.
> This would be done by providing special Annotation
Processors which
> would do all this magic things within the Development
Kit.
>
> It would offer an alternative development method to the
method of
> starting by writing IDL files and generating stubs and
interface classes
> for it by using idlc, javamaker & friends.
>
> This alternate method would be more "javaish"
and lower the entry
> barrier to providing OpenOffice.org extensions in java
if it is feasible.
>
> Of course special AnnotationProcesser would not only be
needed for
> services but also for interfaces, exceptions etc. which
should be
> offered to UNO from java.
>
> What does the UNO team think is this idea feasible, do
you like it?
Not really. There is a mismatch between UNO and Java (e.g.,
in the one
direction, many Java types have no correspondence in UNO,
and in the
other direction, UNO types ANY and
com.sun.star.uno.XInterface both map
to java.lang.Object). And my personal opinion is that
(language
neutral) interface design work is quite different from
implementation
work, and thus one benefits from clear separation.
Where Java annotations might be useful is for registering
Java-implemented UNO services and singletons. There is a
low prio task
to redesign registration sometime in the future (using a
passive
approach rather than the current active one where code from
the
component is executed during component registration).
-Stephan
> See also:
>
> https://jax-ws.dev
.java.net/nonav/jax-ws-21-ea3/docs/UsersGuide.html#3.1.1_Sta
rting_from_Java_
>
> http:
//developers.sun.com/prodtech/javatools/jsenterprise/nb_ente
rprise_pack/reference/techart/jax-ws2.html
>
> http://java.sun.com/j2se/1.5.0/docs/guide/lan
guage/annotations.html
> http://java.sun.com/j2se/1.5.0/docs/guide/apt/G
ettingStarted.html
>
>
> Kind regards,
> Bernd Eilers
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|