
C# – Designing Applications using Interface

Last time in our discussion on creating Azure storage table, using our developer’s account, we have successfully deployed our Azure storage using the M.S. Azure portal. We also used a tool called Azure Storage Explorer in creating our sample Table which also contains sample Entities. For today’s article I will teach you on basic operations, e.g. (Insert, Select, delete) you can perform on your Azure Storage using a C# Console application.
One time I have this application that was already deployed in the production area, the Business owner of the application informed me about the application encountered a system crash when certain operations were performed. I really had a hard time figuring what caused the abnormal termination because I didn’t implement a logging function. To make the story short, I learned my lesson that for every application developed, you should implement a logging function. So in today’s article I want to show you how to implement a NuGet called NLog for you C# applications.
Many of us programmers have the mentality that it’s just okay to implement codes in anyway as long as it is running. Well to tell you the truth you should already change or move away from that kind of mindset. Software development has its own guidelines like abstraction, refinement, modularity and other same concepts that you can use to guide you during coding and avoid the so-called programming pasta. One tool I use in Visual Studio 2015 is Code Metrics. For today I will show you how to generate Code Metrics on your project. Then I plan to discuss deeper on the different code metrics in the next succeeding articles.
Whoops…. I was not referring to Jason of Friday the Thirteenth movie but to the JSON or JavaScript Object Notation data. Kidding aside JSON nowadays is the medium of data format interchange used for APIs which previously relies heavily in XML format. In today’s article I would like to show you on how to handle JSON data in terms of Serializing and Deserializing in C#.
Enumerations or enums for short is a good programming practice to adapt, for me personally it improves the Readability and Maintainability of once programs. My experience in enums came from a project where in we are communicating to server to process the client data. We used enums to check if the request sent to the server was successful or not. To visualize the use of enums I created a sample application to simulate a scenario where connection test with server happens.
I remember the time when my Team Lead asked me to implement an Event type solution for the problem that we have encountered in our previous projects. It was my first time to implement such technique and I was kinda daunted of the said task. In today’s session I’m going to discuss, in the most simplest manner, about raising and consuming events with and without parameters.
What are Events? Events are way for a Class to provide notifications for its clients. Do you remember when we use a button in a Windows form? When we double click the button it will navigate to Button Click which is an event. It is heavily used in GUI related matters but is still very useful for objects to signal if there were any state changes.
It’s nice to be back here after a long hiatus due to project deadlines, non-stop coding and lots of caffeine intake. For today’s session, I would like to share a simple but helpful technique involving the different throw implementations for Try Catch statement. This technique helped me a lot especially when debugging an application or logging the errors encountered by an application.
So, what is the difference with the Throw statement, Throw ex statement and Throw new Exception ? In order for us to clearly grasp the concept let us take a look at the sample program below:
One important aspect to learn if you want to properly handle types in C# are Boxing and Unboxing. Boxing and Unboxing are just simple to use, but sometimes creates more problems rather than being helpful if not properly used. So lets discuss what are Boxing and Unboxing.