Apache OpenOffice (AOO) Bugzilla – Issue 21150
Q-PCD Programmability-4: UNO ease of Use
Last modified: 2010-10-23 06:10:06 UTC
Product Requirement Simplified OOo API Create Helper classes to ease working with the Office API / UNO Provide an easier API to enable low skill developers to program OOo Function is to simplify coding tasks for Java developers using UNO, by providing appropriate wrapper APIs. Map UNO types to Java language concepts (e.g. XPropertySet -> PropertySet) Provide a more natural binding of UNO into programming languages, i.e. eliminating the queryInterface. Customer Need/Problem Developers need task oriented high-level APIs that can be mixed with regular UNO API calls. The goal of these high-level APIs is to make OOo development easier and much more intuitive. The OOo UNO API has some language concepts that are similar to some Java concepts. However UNO does not use the respective Java objects. Its confusing for developers to deal with two independent sets of objects that fulfill similar tasks. From a Java developers perspective the UNO API looks clunky and complex. The UNO API should provide interfaces or wrappers that make OOo development more intuitive for Java developers. Product Concept This can be divided into three parts, the first being ease of use of UNO itself, second is having a smoother language integration and third we need to simplify the OOo API. The following points are only suggestions and may be used as starting points: UNO ease of use: - remove ?queryInterface? - reduce ?Any? usage - introduce IDL-Templates - introduce IDL-GlobalFunctions - map service concept to concrete types (e.g. Interfaces) - consistent and correct naming - simplified resource management/object lifecycle - support single threaded/not threading aware components - ... Enhance Language Integration: - Java - smart mapping of types, classes and interfaces - use ?instanceof? for optional interfaces - support Java semantics were possible - ... - C++ - support ?new? for Service instantiation - implicitly pass the component context - use ?dynamic casts? for optional interfaces - ... Simplify OOo API: - look how other office APIs work - use defaults - use global functions - reuse well-known concepts
.
added keyword Q-PCD
Stephan, this is yours :-).
Concentrating on the "UNO ease of use: map service concept to concrete types (e.g. Interfaces)" part.
In agreement with KR, this task is now only about "UNO ease of use: map service concept to concrete types (e.g. Interfaces)." That boils down to: 1 Introduce multiple-inheritance interface types, to serve as a replacement for abstract UNOIDL service descriptions. Done, see internal bug #114000#. 2 Expand interface type attributes, to serve as a replacement for UNOIDL service description properties. 3 Introduce a new UNOIDL "component" construct, to serve as a replacement for instantiatable UNOIDL service descriptions. In language bindings, generate code for such components (e.g., static XSomeInterface com.sun...SomeComponent.create(XComponentContext)). 4 Update Dev. Guide. A next big step would be the introduction of generics/templates into UNO. It is unclear whether this can be done in the OOo 2.0 timeframe.
See sub issue 26602 for the next incremental step. Subsequent tasks are: - Adapt Java--langugage-binding UNO-type reflection to new UNO features. - Adapt auxiliary tools to new type registry (registry/tools, rdbmaker). - Add simple generic structs to UNO, that can be used to model maybevoid etc. properties in the type system. In C++, map them to templates. In Java, map them to Object-polymorphism, with the future option of changing javamaker to directly generate class files, and use the Java 1.5 generic features in those class files. - Offer helpers in the C++ and Java language bindings that reflectively implement XPropertySet etc. on top of UNO interface attributes. - Retrofit existing udkapi/offapi services/singletons as (single-)interface--based ones. - Update DevGuide.
Fixed. The last three items of the previous to-do list are tracked by individual issues: helpers: issue 29740 retrofitting: issue 29741 DevGuide: issue 29742
closed
Created attachment 72301