Wednesday, July 4, 2007

.NET 3.0 and Beyond – Heading to Project Unknown?

Here are some points to consider in .NET 3.0 and 3.5.

  1. Scripting over procedural and object-oriented is the case in XAML.
  2. Pointers were NOT added to C# 1.0 but heavy use of generics adds same level of difficulty to C# 2.0 and 3.0. If you are planning to use LINQ (you will have no choice), you can’t bypass generics and attributes.
  3. Harcoded recordsets are back in form VC++ to C# in form of attributes. For example, if you have a Customer class link to a Customer table in database in LINQ and later you add or change a column type, you will have to go back to your code and change the class.
  4. Anders (father of C#) is pushing too much Mathematics in new versions of C#.

Problem with LINQ versus ADO.NET

So far, ADO.NET provides me more flexibility where I don’t have to hard-code my classes based on tables, columns, and their types. Generics are used in LINQ instead. Generics sound generic but actually they are not. Instead of using a DataSet or a DataTable, I have to use a class name, which is hardcoded. In other words, if I have a Customer class linked to a Customer table, I can’t use that for an Order table in the database.

LINQ supports SQL Server database only.

I am still confused about underlying technology is used in LINQ to connect to the database? Is this one of the existing – ODBC, ADO.NET etc or something new?

One of the biggest problems with LINQ I see is no Server side support. Let’s say, I have 1 million records in a table and need only 10 records, I can write a stored procedure and pass some parameters to SP and can filter the records. It makes code more managed and cleaner. Now using LINQ queries, I will be writing SQL in my code and put all looping and filtering in my code. Result? More and more messy code.

In current scenario, if I have a programmer who is not good at database side, I have DBA take care of efficient SPs and let programmer talks to the database via SPs only. Every thing else is hidden from the Programmer. BUT with LINQ, programmers have control over the whole selection process. Result? More and more messy code.

Here is good comparison of various technologies with LINQ, but again, how many developers really need Object-Relational DB objects mapping?

No comments: