class-library 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. * The Class Library
  2. The Class Library should be compatible with Microsoft's .NET
  3. implementation.
  4. Please see the <a href="class-status.html">Class Status</a>
  5. page for a status of who is working on which classes.
  6. We will write as much code as possible in C#. We may need to
  7. interface with code written in C to gain access to the
  8. functionality of libraries like libart, Gtk+, and libc.
  9. ** Contributing
  10. We welcome contributions to the the Class Library. To get
  11. started, check the status page for information about which
  12. APIs are being worked on, and how to get in touch with
  13. individual maintainers.
  14. If you want to work on a class, first check the <a
  15. href="download.html">Classes Distribution</a> to see if it is
  16. not implemented yet, if not, check the <a
  17. href="class-status.html">Class Status</a> to see if someone is
  18. already working on it, and maybe contact them.
  19. If nobody is working on it, mail <a
  20. href="mailto:[email protected]">[email protected]</a>
  21. with the class you want to implement and CC <a
  22. href="mailto:[email protected]">[email protected]</a>.
  23. You can also track live the activities of the Mono CVS module
  24. by subscribing to the <a
  25. href="http://mail.ximian.com/mailman/listinfo/mono-cvs-list">mono-cvs-list</a>
  26. ** Layout
  27. The Class Library resides in the `mcs' module in the directoy
  28. `class'.
  29. Each directory in the directory represents the assembly where
  30. the code belongs to, and inside each directory we divide the
  31. code based on the namespace they implement.
  32. There are two cases when we should consider portability: when
  33. we are dealing with a couple of classes only that differ from
  34. system to system (Consider System.Net and System.IO for Win32
  35. and Unix). In those cases we will just place the files for
  36. example on <t>corlib/System/System.IO/Unix-Console.cs</t> and
  37. <t>corlib/System/System.IO/Win32-Console.cs</t>.
  38. For classes that might differ more (for example, the
  39. implementation of Windows.Forms), we might have different
  40. directories altogether: <t>System.Windows.Forms/Win32</t>,
  41. <t>System.Windows.Forms/Gtk+</t> and
  42. <t>System.Windows.Forms/Cocoa</t>.
  43. ** Using existing components from GNOME.
  44. Our current plan is to implement the GUI tools on top of
  45. Gtk+. The only obstacle here is that applications from Windows
  46. might expect to be able to pull the HWND property from the
  47. widgets and use PInvoke to call Windows functions.
  48. ** Class Library and Win32 dependencies.
  49. There are a few spots where the Win32 foundation is exposed to
  50. the class library (for example, the HDC and HWND properties in
  51. the GDI+). Casual inspection suggests that these can be
  52. safely mapped to Gdk's GC and GdkWindow pointers without
  53. breaking anything.
  54. The only drawback is that support for PInvoke of Win32 code
  55. won't be available. An alternate solution would be to use
  56. portions of Wine, or even to use Wine as our toolkit.
  57. *** Initial GDI+ and WinForms implementation
  58. The initial implementation will use Gtk+ as the underlying
  59. toolkit. Since GTK+ has already been ported to many windowing
  60. systems other than X (including frame buffer, Win32, and BeOS)
  61. its use should cover most applications for most users.
  62. *** Database access
  63. We will implement ADO.NET functionality by reusing <a
  64. href="http://www.gnome-db.org">GNOME-DB</a>. This is an ideal
  65. choice, since GNOME-DB was implemented precisely to provide an
  66. ADO-like system for GNOME.
  67. *** Component Integration
  68. We will provide a new namespace to use GNOME specific features
  69. as well as a namespace to host Bonobo interfaces and classes
  70. in Mono.
  71. ** Licensing
  72. The class library will be licensed under the terms of the GNU
  73. LGPL. Some people have pointed out that the plain LGPL is
  74. troublesome for embedded use of the Mono class libraries. So
  75. we are considering to use the GPL with a special exception
  76. (like the <a
  77. href="http://www.gnu.org/software/classpath/classpath.html">GNU
  78. Classpath</a> project did.
  79. The exception to the GPL would be:
  80. <i>The library is distributed under the terms of the GNU General
  81. Public License with the following exception:
  82. If you link this library against your own program, then you do not
  83. need to release the source code for that program. However, any
  84. changes that you make to the library itself, or to any native
  85. methods upon which the library relies, must be re-distributed in
  86. accordance with the terms of the GPL.</i>
  87. If you are going to contribute, please keep in mind that we
  88. might require you to agree that Ximian might adjust the
  89. license to enable the use of the class libraries on embedded
  90. systems or to develop proprietary applications using Mono.
  91. We suggest that you assign the copyright of your work to the
  92. GNOME Foundation or the Free Software Foundation to simplify
  93. defending the code in case it is used inappropiately.
  94. ** Class Library testing
  95. We need to write regression tests that will verify
  96. the correctness of the class library, compiler, and JIT
  97. engine.
  98. Please write your regression tests using <a
  99. href="http://nunit.sourceforge.net">NUnit</a>
  100. ** Coding conventions
  101. Please follow the conventions on the ECMA specification (On
  102. the Annex Partition) for your coding your libraries.
  103. Use 8 space tabs for writing your code (hopefully we can keep
  104. this consistent). If you are modifying someone else's code, try
  105. to keep the coding style similar.
  106. For a rationale on 8 space tabs, read Linus Torvald's Coding
  107. Style guidelines in the Linux kernel source for a rationale.
  108. *** Missing implementation bits
  109. If you implement a class and you are missing implementation bits,
  110. please put in the code the word "TODO" and a description of what
  111. is missing to be implemented.
  112. *** Tagging buggy code
  113. If there is a bug in your implementation tag the problem by using
  114. the word "FIXME" in the code, together with a description of the
  115. problem.
  116. Do not use XXX or obscure descriptions, because otherwise people
  117. will not be able to understand what you mean.
  118. *** Tagging Lame specs
  119. Sometimes the specification will be lame (consider Version.ToString (fieldCount)
  120. where there is no way of knowing how many fields are available, making the API
  121. not only stupid, but leading to unreliable code).
  122. In those cases, use the keyword "LAMESPEC".
  123. ** FAQ
  124. Frequently asked questions about the class library:
  125. Q: I am writing a new class that overrides one of the system classes,
  126. and I am getting a 1595 warning from the compiler. Should we use a
  127. different namespace?
  128. A: There is a quick solution to the problem, you can pass the command
  129. line argument /nowarn:1595 and this will effectively let you use
  130. your implementation of the code, while overriding the ones from the
  131. system assemblies.