Rationale » History » Version 12

J. Wienke, 10/05/2011 05:11 PM

1 1 J. Wienke
h1. Structure Proposal
2 1 J. Wienke
3 1 J. Wienke
h2. Requirements
4 1 J. Wienke
5 2 J. Wienke
In general, the following requirements try to enforce the general *reusability* of data types.
6 2 J. Wienke
7 2 J. Wienke
* *Visibility*: Data definitions must be easily visible when searching for them to foster reuse. This includes:
8 1 J. Wienke
** Folder browsing
9 1 J. Wienke
** Code completion
10 2 J. Wienke
* *Structuredness*: A structured view on the data is required as an orthogonal perspective to the general visibility in order to find functionally coherent groups of data definitions.
11 2 J. Wienke
* *Stability*: A core set of data definitions must be kept stable as much as possible in order to shield depending software from frequent changes.
12 2 J. Wienke
* *Extendability*: New data type definitions are constantly required. Adding them to the repository must have a low barrier to motivate data type sharing.
13 2 J. Wienke
* *Addressability*: A certain revision of a data type must be uniquely addressable and accessible in order to conserve system states.
14 3 J. Wienke
* *Practicability*: Data type definitions must be usable in an efficient manner in all target languages. This includes also the use of languages where IDL definitions are parsed at runtime and not compiled statically.
15 3 J. Wienke
16 3 J. Wienke
h2. Proposed Solution
17 4 J. Wienke
18 4 J. Wienke
h3. Packaging
19 4 J. Wienke
20 6 J. Wienke
* RST will be split into two separate libraries. Both libraries will be built by the same build-system and use the _same_ naming and structure conventions.
21 6 J. Wienke
** _RST_: stable data type definitions. Types in this library must not use types from beta.
22 6 J. Wienke
** _RST-beta_: new data type definitions which may be modified constantly. Beta-types may include types from stable.
23 6 J. Wienke
* Using the beta library will require explicit requests from the application developer, e.g. by using a separate pkg-config file. Also, e.g. for C++, the headers will be separated into different subdirectories in a way that using the stable library will not make the headers of the beta library automatically available to the compiler.
24 12 J. Wienke
* Libraries will be built for C++, Java and Python.
25 4 J. Wienke
26 1 J. Wienke
h3. Data Type Integration Procedure
27 1 J. Wienke
28 6 J. Wienke
* New data types can be added by every developer to the beta library using the specified style guide.
29 1 J. Wienke
* The RST team will merge the data types from beta to stable from time to time. During this process modifications to the data are explicitly allowed in order to meet the style and quality requirements of the stable library.
30 6 J. Wienke
* We will shortly integrate fundamental data types instable inspired by ROS, Orocos etc.
31 9 J. Wienke
* Modifications to existing data types will make use of protobuf's backwards compatibility features whenever possible.
32 1 J. Wienke
33 1 J. Wienke
h3. Structure
34 6 J. Wienke
35 6 J. Wienke
* The svn will contain a single tree for organizing the data definitions. This tree (i.e. the definition of appropriate categories) will be inspired by the data layout of ROS, Orocos and other robotics middlewares.
36 6 J. Wienke
* Folders in the match the package provided in the IDL files.
37 6 J. Wienke
* A Redmine plugin will be created to browse the list of data types, e.g. in a flat list for easy search.
38 6 J. Wienke
39 6 J. Wienke
h3. Versioning
40 6 J. Wienke
41 6 J. Wienke
* No manual versioning will be used. Especially, no versions will be synchronized with RSB releases. Instead, svn revisions will be the only means of addressing specific versions. svn revisions will be integrated into the library for using them in the code or with the C++ preprocessor.
42 6 J. Wienke
43 6 J. Wienke
h3. Style Guide
44 6 J. Wienke
45 6 J. Wienke
* A style guide will be defined (or the current one will be improved) to cover more aspects, e.g. like the canonical format for the java_outer_classname option.
46 6 J. Wienke
* Even if some contents of the files can be defined canonically, we will not generate them using the build system.
47 7 J. Wienke
* The style guide will explicitly define that data type names do not contain artifacts of their current application. E.g. if a something is used as an event, the data type name must not contain the an event suffix or prefix.
48 8 J. Wienke
* All data types will have a common package, i.e. rst.
49 4 J. Wienke
50 4 J. Wienke
h2. Addressed Requirements
51 4 J. Wienke
52 8 J. Wienke
h3. Visibility
53 8 J. Wienke
54 8 J. Wienke
* The redmine plugin as well as the common namespace for all data types will make them visible through search as well as code completion.
55 8 J. Wienke
* The hierarchical structure will foster the visibility coherent groups of data types.
56 10 J. Wienke
* The possibility to integrate beta types as soon as possible make them visible in an early stage using the same mechanisms like for the stable library. This will foster exchange with other developers on these types.
57 8 J. Wienke
58 8 J. Wienke
h3. Structuredness
59 8 J. Wienke
60 8 J. Wienke
* The proposed hierarchical structure provides a simple means to group messages and prevent the pollution of a single namespace.
61 9 J. Wienke
62 9 J. Wienke
h3. Stability
63 9 J. Wienke
64 9 J. Wienke
* The provided core set of data types will form a common basis for all additions.
65 9 J. Wienke
* The stable library specifies policies for stability of data types definitions with backwards compatibility whenever possible.
66 9 J. Wienke
* By using the same namespaces for the beta library, data types which will be moved to the stable library from beta will not cause changing includes etc. as long as their initial position in the RST structure was well-chosen.
67 10 J. Wienke
68 10 J. Wienke
h3. Extendability
69 10 J. Wienke
70 10 J. Wienke
* By giving (nearly) public write access to the beta library, the barrier for adding or modifying types is quite low, especially compared to a formal review process already in this stage.
71 12 J. Wienke
* The common build system for RST automatically maintains the addition of new files without manual work.
72 8 J. Wienke
73 11 J. Wienke
h3. Addressability
74 11 J. Wienke
75 11 J. Wienke
* Formal releases were rejected to foster constant change for the beta library and the simultaneous build process of both library parts.
76 11 J. Wienke
* SVN revisions already provide a formal way of addressing either the whole library or certain types. Code integration of this versions will make this information easily accessible.
77 11 J. Wienke
78 12 J. Wienke
h3. Practicability
79 12 J. Wienke
80 12 J. Wienke
* Providing compiled libraries of RST decreases the required work in the own build system for generating classes from the IDL files.
81 12 J. Wienke
* For C++ and Java, providing a common library prevents subtle errors which occur if one IDL file is compiled multiple times and linked into one binary.
82 12 J. Wienke
83 4 J. Wienke
h2. Identified Drawbacks
84 8 J. Wienke
85 4 J. Wienke
* The hierarchical structure does not provide a means of creating multiple overlapping organizational structures like e.g. tags would. However, it is the only feasible structure that is visible without processing the files by some kind of script or build system. A solution with symlinks would cause a lot of technical and organization problems. Hence, it was rejected.
86 8 J. Wienke
* Python naming of modules
87 8 J. Wienke
88 8 J. Wienke
h2. Open Issues
89 1 J. Wienke
90 12 J. Wienke
* Control aspects over data types (arne), i.e. is a cca folder good or bad?