Creating a Singleton (Instance) Class in C#

In application development there are various situations in which it makes sense to code a class in a manner that it can be created (instantiated) once and used throughout the lifetime of the application. Generally this type of class is called a Singleton object.

When creating and object, CPU cycles are used up during the:

  • Creation of the Object
  • Initialization of the Object
  • Loading of the Object, including seed data from the dB etc.

Read more

Include Application Name in Connection Strings

In addition to the SQL Server, Database, User ID and Password, you may want to include the Application Name in your connection string parameters. Application Name is an optional argument, but it can greatly help you to segregate the SQL that your application is executing from any other database calls that are being sent from other applications/processes.

Data Source=myServer;
Initial Catalog=myDB;
User Id=myUsername;
Password=myPassword;
Application Name=myApp;

In example:

Read more

Jose Jose sings “El Triste” at the Latin Music Festival II 1970

José José’s big break came on March 25, 1970, when he represented Mexico in an international song festival, the “II Festival de la Canción Latina” (Latin Song Festival II, the predecessor of the OTI Festival) with an amazing performance of the song “El Triste“. The performance of the song was so impressive that caused tears, … Read more

The Object-Oriented Thought Process …

Recently I came across a book which was a recommendation from a senior colleague at work. The Object-Oriented Thought Process by Matt Weisfeld. Although the first three chapters can seem a bit basic at first glance, they help to remind ourselves and reset in our minds what a true OO approach to a given problem should be.

Here is the Conclusion for (summary) Chapter 1 – Introduction to OO Concepts:

Read more

Nick Adenhart – Rest In Peace …

Although this is a development and technology blog, I could not help but to spend some time writing a few thoughts regarding the death of Los Angeles Angels rookie prospect pitcher, Nick Adenhart, who died at the tender age of 22 years young, hours after having pitched the best game of his brief major league career.

Nick Adenhart was a man I never met and one who’s profile and image was not readily fresh in my mind. After all, He was a rookie pitcher that attained the 3rd spot in the Angels rotation because of injuries to their top 3 pitchers. To be fair to Nick, he did have a pretty good spring training and he did come into the season as the 3rd starter.

Read more