I have been thinking recently about the requirements of a good developer. But, I think I must first clarify what I mean when I use the term “developer”. My experience as a developer has, I feel, been different from a good number of others. For me, development meant much more than just being a simple code-monkey. Development meant shepherding a new application from its infancy as an idea in the minds of the users and/or management to a fully functional application deployed to a working environment. It is only in my recent experience that I have discovered this is not always the case. Indeed, if anything, perhaps my experience is the aberration among developers.
This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.
As database professionals, our intent is to be as proactive as possible when it comes to delivering data with security, stability and speed in mind. Being proactive means active monitoring, reporting performance variations and most important, baseline capture. Adding to these three objectives, we can add Performance Notes to also provide key points of long term and short term performance problems. Let’s take a minute to discuss the three key points (Baselines, Active Monitoring and Reporting Performance)
Introduction You might have noticed that I am switching to WPF from winforms. I’m doing this gradually, but DI/IoC is making this very painless. For the moment I have both in the same app. I have not seen any problems yet. One of the advantages of WPF is that you can do theming, this lets you can change the look of your application in a single line of code. I guess you can do something similar in winforms but it needs a lot more work. First I will show you how easy it is to theme your application and then how much easier it is if you refactor your code to a pattern. “What pattern?”, I hear you ask. Well I don’t really care for the moment.
Lately we’ve been playing around with RIA services for Silverlight. Using them we lose the use of our stack, but the speed of development with them is quite impressive. Watch and Learn If you are unfamiliar with RIA in Silverlight, I would recommend this video: http://www.silverlight.net/learn/videos/all/net-ria-services-intro/. It is a complete walk through of creating a demo from the ‘Business Application’ template in Visual Studio for SL 3. If you are working in SL4, be sure to check the comments in the video for the breaking changes.
Introduction In VB9 we already had some anonymous delegate support but only with Functions. In other words your method needed to return a value for this to work. In VB10 we also have anonymous delegate support for methods that don’t return anything (void). This comes in very handy when you have to test some events and their return value. Prerequisites This is the class we are going to test. Public Class Messages Public Sub AddMessage(ByVal Message As String RaiseEvent MessageAdded(Message) End Sub Public Event MessageAdded(ByVal Message As String) End Class``` The above is a very simple class. You can just image that the AddMessage method add something to a list. MessageAdded just tells the obeservers that it is time to update them selfs. Pretty simple so far. ## An example of old This is how I would have to test this in VB9 ```vbnet <TestFixture()> _ Public Class TestMessages Private _Facade As Messages <Test()> _ Public Sub IfAddMessageReturnsMessage() _Facade = New Messages() AddHandler _Facade.MessageAdded, AddressOf IfAddMessageReturnsMessageHandler _Facade.AddMessage("Test") End Sub Private Sub IfAddMessageReturnsMessageHandler(ByVal message As String) Assert.AreEqual("Test", message) End Sub End Class AS you can see I need an extra method here. If IfAddMessageReturnsMessageHandler would have been a Function it would have been easier, but eventhandlers are never Functions ;-).
I was looking at the stack they used for the new channel9 website. MVC 2.0, Unity (from P&P), NHibernate, Fluent NHibernate, Memcached, Enyim Managed Memcached driver, Azure – Fabric, Storage, Diagnostics, SQL Azure, xUnit (testing only), Live ID, Spark View Engine, Akismet (spam filtering service), AntiXSS, Tinymce, jQuery, and Silverlight. You can watch the video by Mike Sampson on how they built the new site if you want to know more.
Do you need an SSRS 2005 report that displays totals for the previous 3 months going horizontally across ? Well, I did, and my first approach involved using derived tables, each with a separate date range, to get each month’s total to appear in its own column. While I achieved my goal, performance was lousy because the query needed to execute 3 times (once for each date range). I shaved 2 minutes off the query execution time with a second approach. This alternate approach involves using a single query for the entire, 3-month date range, along with a GROUP BY clause including year and month. For the SSRS piece, I use a matrix format to get the months to display horizontally across. Since I have additional columns to display besides the total, I have to do some extra maneuvering, but more on that, later.
Introduction A few days ago I made a post on how to make a factory with T4 templates. That version only made one factory for one namespace. So it was pretty limiting. But as you could see, in that example, we had 2 namespaces, namely Test and Test2. We need a factory for both those namespaces. We can either copy/paste or change our template to produce more files. After all, these files are nearly the same.
I wrote a blog post 437 days ago asking you the reader if you would be interested in a FxCop tool for SQL Server. That post can be found here: SQLCop, FxCop For SQL Server, Would You Be Interested in This?. Today I am pleased to announce that the first version of this tool is available. The tool is free and will remain free, we will never charge for it. The tool is only 412 kb to download and no installer is needed. The reason we didn’t do an add in in SSMS is because we wanted people to be able to run it it by itself. The tool was tested on Windows XP, Vista and Windows 7 (64 and 32 bit)
The recent thread in ASP.NET forums is the primary reason for this blog post. I want to show how error messages from the SQL Server were handled in our web pages. The site I was working on had most of the functionality developed by the previous developer. Unfortunately, most pages didn’t use a separation of layers and used SQLDataSource for data manipulations. The sample I want to show was called from InsertPerson.aspx page. For inserting a person we used the stored procedure I showed in my previous blog How to insert information into multiple related tables and return ID using SQLDataSource.