You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
9.1 KiB

  1. <?xml version="1.0" encoding = "iso-8859-1" standalone="no"?>
  2. <!--
  3. * Licensed to the Apache Software Foundation (ASF) under one or more
  4. * contributor license agreements. See the NOTICE file distributed with
  5. * this work for additional information regarding copyright ownership.
  6. * The ASF licenses this file to You under the Apache License, Version 2.0
  7. * (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. -->
  18. <!DOCTYPE faqs SYSTEM "sbk:/style/dtd/faqs.dtd">
  19. <faqs title='Contributing to &XercesCName;'>
  20. <faq title="Submitting Patches">
  21. <q>I have a problem and I think I know how to fix it. How can I
  22. communicate my ideas to the &XercesCName; team?
  23. </q>
  24. <a>
  25. <p>To maximize the probability that your ideas will grab the
  26. attention of one of the &XercesCName; developers who knows about the
  27. area of the parser you're concerned with, you should follow
  28. these steps:
  29. </p>
  30. <ol>
  31. <li>Check out and build the most recent &XercesCName; code. For
  32. instructions on how to do this, see <jump href="&RepURI;">&XercesCName;
  33. Repository Information</jump>. If you do this, you can confirm that your
  34. bug still exists and has not been fixed since the last
  35. release.
  36. </li>
  37. <li>
  38. Write up your bug report as per the instructions described in
  39. the <jump href="&BugURI;">Bug-Reporting</jump> page.
  40. </li>
  41. <li>
  42. Describe why your solution works.
  43. </li>
  44. <li>
  45. Prepare a patch to fix &XercesCName; code. To do this, when you
  46. have applied your changes to a local copy of the most
  47. recent &XercesCName; source code, do <code>svn diff file</code>
  48. for each file you have changed.
  49. Keep in mind the coding guidelines for &XercesCName; as
  50. described below.
  51. </li>
  52. <li>
  53. Zip (or tar) up your patches. If you send them in the
  54. body of a message or bug report they are very difficult to
  55. apply.
  56. </li>
  57. <li>
  58. Submit a bug report to the &XercesCName; bug database as
  59. described on the <jump href="&BugURI;">Bug-Reporting</jump> page.
  60. Pick the product "&XercesCName;" (remembering to attach your patches
  61. and test code) or, if you think your patch might need some discussion,
  62. post it to the <jump href="&MailURI;">developer mailing list</jump>.
  63. </li>
  64. <li>
  65. If you are submitting a substantial amount of code, provide the
  66. information required in the Contributors section of the Project
  67. Charter.
  68. </li>
  69. </ol>
  70. </a>
  71. </faq>
  72. <faq title="Release Policy">
  73. <q>What are the release policies for &XercesCName;?
  74. </q>
  75. <a>
  76. <p>The informal release policies for &XercesCName; are (using a versioning of version.release.modification):</p>
  77. <ul>
  78. <li>We don't try to enforce binary compatibility between new versions and releases.</li>
  79. <li>New versions and releases will be delivered when a certain number of bug fixes/new features have been added
  80. (as decided by the committers).</li>
  81. <li>New modification levels will almost never be issued, the only exception is a showstopper bug encountered within
  82. a release.</li>
  83. <li>Any normal bug is fixed only in the HEAD branch (latest development code).</li>
  84. </ul>
  85. <p>The specific source and binary compatibility objectives for these release policies and the corresponding allowed source changes are:</p>
  86. <ul>
  87. <li>x.x.x to x.x.y: the API is the same to ensure binary compatibility.</li>
  88. <ul>
  89. <li>To maintain binary compatibility the allowed source code changes are:</li>
  90. <ul>
  91. <li>Add new non-virtual functions.</li>
  92. <li>Add new classes.</li>
  93. <li>Add new STATIC data members.</li>
  94. </ul>
  95. <li>To maintain binary compatibility you cannot:</li>
  96. <ul>
  97. <li>Add new virtual functions as this will change the layout of the virtual function table.</li>
  98. <li>Change the order of virtual functions in the class declaration.</li>
  99. <li>Change the signature of a function (including adding additional parameters with defaults).</li>
  100. <li>Change the access specifier (private/public/protected) on functions or data members as this may be part of the signature with some compilers.</li>
  101. <li>Add new data members to a class (other than STATIC members).</li>
  102. <li>Change the order of data members in the class declaration (other than STATIC members).</li>
  103. <li>Change the class hierarchy (other than adding new classes).</li>
  104. </ul>
  105. <li>Methods that are deprecated should be marked with the Doxygen tag @deprecated in the header file.</li>
  106. </ul>
  107. <li>x.x.x to x.y.z: the API is source code compatible but not binary compatible (a recompilation of an application that uses the public headers of &XercesCName; should work).</li>
  108. <ul>
  109. <li>This means that to maintain release to release source code compatibility the signature of public methods can only be
  110. changed by adding default parameters.</li>
  111. <li>Signatures of private and protected methods can be changed and/or removed.</li>
  112. <li>Methods that are deprecated should be marked with the Doxygen tag @deprecated in the header file.</li>
  113. </ul>
  114. <li>x.x.x to a.b.c: the API may not be source code compatible and is not binary compatible (a recompilation of an application using &XercesCName; may fail).</li>
  115. <ul>
  116. <li>In this situation, a separate branch of the code will be created so that bug fixes may be applied to the last version.</li>
  117. <li>Deprecated methods may be removed. Deprecated methods that are removed should be documented in the migration information (migration.xml).</li>
  118. </ul>
  119. </ul>
  120. </a>
  121. </faq>
  122. <faq title="Coding Conventions">
  123. <q>What are the coding conventions for &XercesCName;?
  124. </q>
  125. <a>
  126. <p>As with any coding effort, there are always arguments over what coding conventions to use. Everyone thinks
  127. that they have the best style which leads to the entire source tree looking different. This causes consternation
  128. as well as eye fatigue on subsequent developers that need to maintain the code. Therefore, we are going to
  129. make an attempt at defining some basic coding conventions for &XercesCName;. When committing files or providing
  130. patches please keep them in mind:</p>
  131. <ol>
  132. <li>All classes should have a constructor, destructor, assignment operator and copy constructor to
  133. avoid compiler generated default versions of these.</li>
  134. <ul>
  135. <li>If a class contains only static methods, only a private constructor is required.</li>
  136. <li>If a class contains any virtual methods, the destructor should be virtual.</li>
  137. <li>If a class has a public or protected constructor, it should declare private assignment operator
  138. and copy constructor which are not implemented (unless of course you need either of these).</li>
  139. </ul>
  140. <li>If you add a catch(...) block be sure to add the following block
  141. <code>
  142. catch(const OutOfMemoryException&amp;)
  143. {
  144. throw;
  145. }
  146. </code> so the OutOfMemory condition does not get absorbed.</li>
  147. <li>If you change the serialization format (by adding something to be serialized or removing something that
  148. was serialized) increment the XERCES_GRAMMAR_SERIALIZATION_LEVEL constant in XercesVersion.hpp.</li>
  149. <li>If a class allocates memory or is instantiated with new then it should inherit from XMemory.</li>
  150. <li>Use a tab size of 4 and insert them as spaces instead of keeping tabs.</li>
  151. <li>The code is written to be platform independent. Platform specific code should only be in the
  152. util/FileManagers, util/MutexManagers, util/Transcoders, util/MsgLoaders, and util/NetAccessors directories.</li>
  153. <li>The header file name and the source file name should both be named corresponding to the primary
  154. class they contain. For example class StringPool should be in the header file StringPool.hpp and in
  155. the source file StringPool.cpp.</li>
  156. <li>In general, code should be documented with comments. Use Doxygen tags to describe methods.</li>
  157. <li>The naming convention for enumerations should be chosen to be unique and descriptive
  158. (i.e. INVALID or UNKNOWN) to avoid colliding with predefined macros in other
  159. products. The current style of using ALL CAP enums should be phased out with
  160. Mixed Case instead, except for names specified in standards (for example, TEXT_NODE
  161. should not be converted to mixed case for standards compliance).</li>
  162. </ol>
  163. </a>
  164. </faq>
  165. </faqs>