class-library 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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://lists.ximian.com/mailman/listinfo/mono-cvs-list">mono-cvs-list</a>
  26. ** Missing features
  27. Our class libraries miss some features, for example, most classes
  28. do not implement the serialization bits at all, it would be a good
  29. contribution to add this to each class.
  30. This is a simple task, but it needs to be done in a compatible way
  31. with the Microsoft.NET classes: using the same arguments to serialize
  32. and reincarnate data.
  33. ** Layout
  34. The Class Library resides in the `mcs' module in the directoy
  35. `class'.
  36. Each directory in the directory represents the assembly where
  37. the code belongs to, and inside each directory we divide the
  38. code based on the namespace they implement.
  39. There are two cases when we should consider portability: when
  40. we are dealing with a couple of classes only that differ from
  41. system to system (Consider System.Net and System.IO for Win32
  42. and Unix). In those cases we will just place the files for
  43. example on <t>corlib/System/System.IO/Unix-Console.cs</t> and
  44. <t>corlib/System/System.IO/Win32-Console.cs</t>.
  45. For classes that might differ more (for example, the
  46. implementation of Windows.Forms), we might have different
  47. directories altogether: <t>System.Windows.Forms/Win32</t>,
  48. <t>System.Windows.Forms/Gtk+</t> and
  49. <t>System.Windows.Forms/Cocoa</t>.
  50. ** Using existing components from GNOME.
  51. Our current plan is to implement the GUI tools on top of
  52. Gtk+. The only obstacle here is that applications from Windows
  53. might expect to be able to pull the HWND property from the
  54. widgets and use PInvoke to call Windows functions.
  55. ** Class Library and Win32 dependencies.
  56. There are a few spots where the Win32 foundation is exposed to
  57. the class library (for example, the HDC and HWND properties in
  58. the GDI+). Casual inspection suggests that these can be
  59. safely mapped to Gdk's GC and GdkWindow pointers without
  60. breaking anything.
  61. The only drawback is that support for PInvoke of Win32 code
  62. won't be available. An alternate solution would be to use
  63. portions of Wine, or even to use Wine as our toolkit.
  64. *** Initial GDI+ and WinForms implementation
  65. The initial implementation will use Gtk+ as the underlying
  66. toolkit. Since GTK+ has already been ported to many windowing
  67. systems other than X (including frame buffer, Win32, and BeOS)
  68. its use should cover most applications for most users.
  69. *** Database access
  70. We will implement ADO.NET functionality by reusing <a
  71. href="http://www.gnome-db.org">GNOME-DB</a>. This is an ideal
  72. choice, since GNOME-DB was implemented precisely to provide an
  73. ADO-like system for GNOME.
  74. *** Component Integration
  75. We will provide a new namespace to use GNOME specific features
  76. as well as a namespace to host Bonobo interfaces and classes
  77. in Mono.
  78. ** Licensing
  79. The class library is being licensed under the terms of the
  80. <a
  81. href="http://www.opensource.org/licenses/mit-license.html">MIT
  82. license.</a> This is the same license used by the X11 window
  83. system.
  84. ** Class Library testing
  85. We need to write regression tests that will verify
  86. the correctness of the class library, compiler, and JIT
  87. engine.
  88. Please write your regression tests using <a
  89. href="http://nunit.sourceforge.net">NUnit</a>
  90. ** Coding conventions
  91. Please follow the conventions on the ECMA specification (On
  92. the Annex Partition) for your coding your libraries.
  93. Use 8 space tabs for writing your code (hopefully we can keep
  94. this consistent). If you are modifying someone else's code, try
  95. to keep the coding style similar.
  96. For a rationale on 8 space tabs, read Linus Torvald's Coding
  97. Style guidelines in the Linux kernel source for a rationale.
  98. *** Missing implementation bits
  99. If you implement a class and you are missing implementation bits,
  100. please put in the code the word "TODO" and a description of what
  101. is missing to be implemented.
  102. *** Tagging buggy code
  103. If there is a bug in your implementation tag the problem by using
  104. the word "FIXME" in the code, together with a description of the
  105. problem.
  106. Do not use XXX or obscure descriptions, because otherwise people
  107. will not be able to understand what you mean.
  108. *** Tagging Lame specs
  109. Sometimes the specification will be lame (consider Version.ToString (fieldCount)
  110. where there is no way of knowing how many fields are available, making the API
  111. not only stupid, but leading to unreliable code).
  112. In those cases, use the keyword "LAMESPEC".
  113. ** Namespaces
  114. We are using a number of namespaces in the class libraries for
  115. private classes when we need them, you are encouraged to use these:
  116. <pre>
  117. Mono
  118. .Languages // General Compiler classes
  119. .CSharp // Specific C# parsing/tokenizing classes
  120. .MonoBASIC // Specific VB.NET/MonoBASIC parsing/tokenizing classes
  121. .Python // Specific Python parsing/tokenizing classes
  122. .Runtime
  123. .LateBind // General latebinding-support for MonoBASIC/Python
  124. .MonoBASIC // Specific runtime classes for MonoBASIC programs
  125. .Python // Specific runtime classes for Python programs
  126. .Web
  127. .UI
  128. .Utils // Gaurav utility classes
  129. </pre>
  130. ** FAQ
  131. Frequently asked questions about the class library:
  132. Q: I am writing a new class that overrides one of the system classes,
  133. and I am getting a 1595 warning from the compiler. Should we use a
  134. different namespace?
  135. A: There is a quick solution to the problem, you can pass the command
  136. line argument /nowarn:1595 and this will effectively let you use
  137. your implementation of the code, while overriding the ones from the
  138. system assemblies.