2010-04-16 Sebastien Pouliot <sebastien@ximian.com>
[mono/afaerber.git] / web / tds-providers
blob6442e69601aefb040f7b2c2673780fc7747a4184
1 * Design of the Microsoft SQL Server, Sybase, and TDS Data Providers in Mono
3         <ul>
4                 * After much discussion among the Mono ADO.NET developers,
5                   we have come up with the design of implementing a Sybase, Microsoft 
6                   SQL Server, and TDS Generic ADO.NET providers.  These providers have
7                   been created and are actively developed by Tim Coleman.
9                 * Since Sybase and Microsoft SQL Server databases both 
10                   use the TDS protocol for data access, and other implementations 
11                   of TDS (FreeTDS and jTDS) have included support for multiple 
12                   versions of the TDS, we have decided to do the same.
14                 * The TdsClient ADO.NET provider will be Mono's first provider 
15                   written completely in C# without any dependencies except 
16                   the usual suspects: corlib.dll, System.dll, and System.Xml.dll.
17         </ul>
19 * New ADO.NET Providers
21 <p>There will be three ADO.NET providers that will use TDS.     
23                 <ol>
24                   <li><p>Mono.Data.SybaseClient namepace and assembly will 
25                   hold the ADO.NET provider for Sybase SQL Server database.  
26                   This provider uses TDS version 5.0 which 
27                   can only be used with Sybase databases.
29                   <li><p>System.Data.SqlClient namespace and System.Data assembly 
30                   will hold the ADO.NET provider
31           for Microsoft SQL Server 7.0/2000 databases.  This provider is to be 
32           compatible with SqlClient in Microsoft .NET and uses TDS version 7.0 
33           which only supports Microsoft SQL Server 7.0/2000.  
34           There is TDS version 8.0 
35           which we will need to support as well, but it is used for 
36           Microsoft SQL Server 2000 databases.
38                   <li><p>Mono.Data.TdsClient namespace and assembly is a generic 
39                   provider for older TDS databases.  This provider will default to 
40                   using TDS version 4.2 which can be used by older Sybase and 
41                   Microsoft SQL Server databases.
42                  </ol>
44 * Building The New Providers
46  <p> All three providers will use common internal code 
47                 at Mono.Data.TdsClient.Internal.  Any classes in 
48                 Mono.Data.TdsClient.Internal will have the internal 
49                 keyword and will be built with the assembly of that provider.
50                 <ol>
51                 <li><p>SqlClient will build its assembly System.Data using files 
52                   from System.Data, System.Data.SqlClient, System.Data.SqlTypes, 
53                   System.Data.Common, and Mono.Data.TdsClient.Internal.  
54                  
55                   <p>SqlClient 
56                   will only reference the usual
57                   suspects: corlib.dll, System.dll, and System.Xml.dll. SqlClient will be 
58                   a wrapper around TdsClient.Internal, but provide specific functionality to
59                   Microsoft SQL Server 7.0/2000 databases.
61                   <p>SqlClient build example:
63 <pre>
64  mcs -target:library -out:System.Data.dll \
65    System.Data.SqlClient/*.cs \
66    ..\Mono.Data.TdsClient\Mono.Data.TdsClient.Internal\*.cs \
67    [any other classes in System.Data assembly...]  \
68    -r corlib.dll -r System.dll -r System.Xml.dll
69 </pre>
71                 <li><p>SybaseClient will build its assembly Mono.Data.SybaseClient using 
72                   files from Mono.Data.SybaseClient and Mono.Data.TdsClient.Internal.  
73                   SybaseClient will reference
74           the usual suspects plus System.Data.dll  SybaseClient will 
75           be a wrapper around TdsClient.Internal, but provide specific 
76           functionality to Sybase.
78                   <p>SybaseClient build example:
80 <pre>
81  mcs -target:library -out:Mono.Data.SybaseClient.dll \
82     Mono.Data.SybaseClient\*.cs \
83     ..\Mono.Data.TdsClient\Mono.Data.TdsClient.Internal\*.cs
84     -r corlib.dll -r System.dll -r System.Xml.dll -r System.Data.dll
85 </pre>
86     
87                 <li><p>TdsClient will build its assembly Mono.Data.TdsClient 
88                   using files from Mono.Data.TdsClient
89           and Mono.Data.TdsClient.Internal.  TdsClient will reference the 
90           usual suspects plus System.Data.dll  TdsClient is a wrapper 
91           provider around TdsClient.Internal used for generic
92           unit tests.  TdsClient will a wrapper around TdsClient.Internal 
93           as a generic TDS provider 
94           and allow TDS configuration options not exposed in SqlClient 
95           nor SybaseClient, such as, TdsVersion will be exposed in TdsClient 
96           but not in SqlClient nor SybaseClient.
98                  <p>TdsClient build example:
100 <pre>
101 mcs -target:library -out:Mono.Data.TdsClient.dll \
102     Mono.Data.TdsClient\*.cs \
103     Mono.Data.TdsClient.Internal\*.cs \
104     -r corlib.dll -r System.dll -r System.Xml.dll -r System.Data.dll
105 </pre>
106                 </ol>
107     
108 * Classes in Mono.Data.TdsClient.Internal will:
110         <ul>
111         <li>use the internal keyword to prevent exposing these classes
112           to the System.Data.dll assembly.
113           
114     <li> implement the ADO.NET interfaces just like any other ADO.NET provider, such as,
115           IDbConnection, IDbCommand, IDataReader, IDataRecord, IDataAdapter, etc...
116           
117     <li> be sealed just like other providers
118         
119     <li> provide features to be directly used by the SqlClient and SybaseClient 
120           providers, such
121           as, setting the default TDS version: SqlClient to 7.0 and SybaseClient 
122           to 5.0 and TdsClient to 4.2.
123           
124     <li> be written completely in C# or IL assembly language (if need be).
125         
126     <li> implement the TDS protocol version 4.2, 5.0, 7.0, and 8.0. This 
127           is where most of the
128           work will take place.
129           
130     <li> be an internal ADO.NET provider to the public ADO.NET providers:
131           System.Data.SqlClient, Mono.Data.SybaseClient, and Mono.Data.TdsClient.
132         </ul>
134 * Implementation Details of the TDS Protocol
136         <ul>
137                 * will be implemented in pure C# from scratch
138                 
139                 * will reside in Mono.Data.TdsClient.Internal  
140                 
141                 * will use FreeTDS and jTDS as rerferences.
142         </ul>
144 * More Information
146         <ul>
147                 * <a href="http://www.freetds.org/">FreeTDS</a> is C API that implements
148                 the TDS protocol.  Has libraries for tds, ctlib, and dblib.  It builds
149                 and runs on Windows, Linux, and other platforms.  FreeTDS provides
150                 data access to Microsoft SQL Server and Sybase databases. 
151                 
152                 * <a href="http://jtds.sf.net/">jTDS</a> is a 100% Java JDBC provider
153                 for Microsoft SQL Server and Sybase databases.
154                 
155                 * <a href="http://www.freetds.org/tds.html">TDS Protocol</a>
156         </ul>
158 * Contribute
160         <p>Anybody willing to help?  If so, 
161                 contact any of the people working on the ADO.NET support 
162                 in Mono: Rodrigo Moya, Tim Coleman, Daniel Morgan, Brian Ritchie, 
163                 Vladimir Vukicevic, Ville Palo, Franklin Wise, and others.