TDO – Typed Data Object

26 Mar


Every time we have to develop a n-tiers application, that works on a database, we need to write source code to use these data.  In an object oriented environment, the source code has to be modeled in classes and encapsulated in a Data layer and then used in a Business layer.

During the development process of an application we can say that: 

– The code for the Business layer always comes from the Customer demand (Business Requirements), and such requirements are different every time. 
– The code of the Data layer always comes from the operations made on data, and such functions are always the same (Select, Insert, Update, SPs, ….).
The structure of the Database is created properly to support indirectly, the Customer demand, and directly, the requirements of the application that can change. If we get our attention on Data layer, we can see that all the source code, needed to access those data (Data Object), will not be bind directly to the Customer demand, but it will be bind to the Database structure. This means that every time we have to re-write the Data Object for the specifically database.

Solution: Andrea Ferendeles  has developed TDO – Typed Data Object is a .NET source code generator (C#/VB) for data layers based on Microsoft SQL Server 2000/MSDE/2005/Express. Which allows .NET Framework 2.0 developers, to have the source code automatically generated for MS SQL Server databases. It is made up of a NET assembly (Tdo.dll) and a source code generator (TdoCodeGenerator.exe). The source code generator produces a collection of derived classes (VB.NET/C#.NET) that extends the base classes within the Tdo.dll assembly, all under the Object Oriented model.


Every generated class has the scope “to represent” an object of your SQL database, where object are Tables, Views, Stored Procedures, Functions. According to this model, every table or view, etc…, is considered as an object itself that shows its attributes and operations (that are properties and methods).

That means that the single cell of a table or the single parameter of a stored procedure will be seen as object itself. All these classes are enclosed in a hierarchically macro-object as a representation of the entire database – the TdoHelper class.

More ahead we’ll see all the possible operations that we can execute on our database (select, insert, update, delete, stored procedure, etc…) that will be called from the present methods within the TdoHelper class objects.


To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body ‘help’ to tdo-users-request@lists.sourceforge.netYou can reach the person managing the list at

1 Comment

Posted by on March 26, 2007 in ADO.NET


One response to “TDO – Typed Data Object

  1. What about the perfomance???

    March 29, 2007 at 4:42 am

    What about the perfomance???

    You didn’t mention about the perfomance of the same.

    There is a different project my MS itself called SPOIL(FYI).

    Regards ,



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: