Archive for April, 2009

Thoughts on Application development

I recently started a new job, and in my current environment I have a C# developer, who comes from a Windows Forms Development background, an SQL Server 2000/2005 DBA, a VB.NET/AJAX/JavaScript developer and another VB.NET developer. There is another guy that does C# as well. I must honestly say that working with all of them has proven that every single developer has his/her preferred approach to development. For instance the SQL Server 2000/2005 DBA and the VB.NET/AJAX/JavaScript developer work closely together and they seem to build all their application logic into SQL Server. The stored procedures that they build handle the majority of the application logic. And there is nothing wrong with this approach, but in my mind Microsoft have gone to great lengths to make things like data structures readily available in C# and VB.NET. Why do I say that? Because I prefer doing my application logic in the C# application. Are there any real performance benefits?

  • Share/Bookmark

Creating a pivot like structure – without using any server controls!

Ok, so programming is a challenge as all programmers should know, and this is the caveat that programming gives you. On the one hand its difficult but on the other hand you get to try so many approaches to developing one particular aspect that it gives you the opportunity to learn a lot. So here is my scenario:

I have to create a pivot-like table without the use of server controls – everything has to happen in the code. In most of my work at the moment we do not use server controls – everything is purely AJAX and uses SOAP calls to web services to generate the user interface. So there is no cool way of tallying things up, you gotta do it yourself, the SOAP response has to display the data. So typically this solution has a first column on the left and a first row on the top that represents the ‘labels’, and between the two aggregate values are generated in the area between the label areas where they intersect. So any intersecting value between the two should give you a total made up from the two. The last column in the table contains a running total of each row and the last row keeps a running total as well.

From the description it is clear that you have several ‘fixed’ variables, or fixed areas:

  • The y-axis labels
  • The x-axis labels
  • The y-axis running total
  • The x-axis running total
  • The data area

The variables or objects defined above should be able to accept any data and display it accordingly. How do you approach it though? What approach do you follow to achieve the correct SOAP response message? C# 3.0 provides several technologies to do this:

  • Generics, lists, dictionaries
  • ADO.NET which provides you with data access
  • Share/Bookmark

using System.Web.UI.DataVisualization.Charting;

Ok so I recently got a request to do a project that uses all kinds of pretty charts, and initially the development team wanted to use Open Flash Charts, but the developer I was working with on the project was on leave for two days and in that time I decided to check out New ASP.NET Charting Control: . First thing you need to do is download the free Microsoft Chart Controls and install that on your machine. Note that once installed it creates a folder under Program Files called Microsoft Chart Controls, with another folder called Assemblies under that, which contains DLL’s for both web and application. Once you have installed Microsoft Chart Controls you can choose to add the VS 2008 add-on if you are going to be doing web-forms development, but if like me you use a lot of web services and AJAX, you may not need it. So how do you get to use it then otherwise? By adding these two lines in your web.config file:



You then have access to a range of classes by typing the fully qualified namespace like this:

System.Web.UI.DataVisualization

Once you have access to the classes you can do all sorts of interesting things. You get to choose from 35 different chart types, that you can format with colours, 3D effects. And you can also use data with it very easily with a datareader, which impressed me. You can also save your charts as images.

  • Share/Bookmark
Get Adobe Flash playerPlugin by wpburn.com wordpress themes