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