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