Fredrik Normén

ASP.NET, AJAX, Silverlight, RIA, Architecture, Clean Code

  • ASP.NET Web API Exception Handling

    When I talk about exceptions in my product team I often talk about two kind of exceptions, business and critical exceptions. Business exceptions are exceptions thrown based on “business rules”, for example if you aren’t allowed to do a purchase. Business exceptions in most case aren’t important to log into a log file, they can directly be shown to the user. An example of a business exception could be "DeniedToPurchaseException”, or some validation exceptions such as “FirstNameIsMissingException” etc.

  • Log message Request and Response in ASP.NET WebAPI

    By logging both incoming and outgoing messages for services can be useful in many scenarios, such as debugging, tracing, inspection and helping customers with request problems etc.  I have a customer that need to have both incoming and outgoing messages to be logged. They use the information to see strange behaviors and also to help customers when they call in  for help (They can by looking in the log see if the customers sends in data in a wrong or strange way).

  • Build, first day

    It was an interesting day at the Microsoft Build Conference. I will in this blog post share some of the things that were presented during the first Keynote and big screen day.

    The keynote started to present Windows 8, and the Metro (The new GUI). Focus was on the new user experience and UI. As many of you have probably already seen, the UI is similar to Windows Phone 7 and is created for touch. The idea of the Metro UI is to bring everything in front of the user, easy to find what they want and need. Microsoft wanted to make Windows 7 even better. Everything that runs on Windows 7 runs on Windows 8.

    They reimage Windows to experience a new range of capabilities, scenarios, and factors. Windows 8 uses about 281 Mb memories and in the size an antivirus program is also running. One feature I like the most was the Spell Checking through the whole system Windows 8 will be a great new platform for developers.

    Developers can use the new WinRT API to build great apps, they can use different kind of languages, like HTML/CSS and Java-script, XAML and C# or VB, C or C++. The interesting part is HTML and Java-script. It will make it much easier to move web developers into writing Mobile apps and Windows 8 apps in an easy way. App developers want rich connectivity and sharing capabilities, connection to customers. Reach every customer using Windows. Touch will be the future, and the WinRT deliver it all. Developer can use the WinRT APIs for Communication & Data, Graphics & Media, Devices and Printing. Contracts can be used to make app communicate with each other, an example of an Contract is the "Search Contract", that can be used to hook up an app into the Windows 8 "search engine". There are different ways apps can communicate with each other, loacaly, Scheduled or with Push (using Windows Push Notification WSN). With Tiles developer can extend the apps with information instead of using an icon.

    Developers will get a set of great of tools for writing Windows 8 apps. With Visual Studio 11 and Expression Blend 5, developers can be up and running in a short time by using predefined templates. Expression Blend 5 will now handle HTML and Java-script, and Blend is now integrated into Visual Studio 11. Visual Studio 11 also has a simulation feature when it comes to debugging, so developers could select for example a Slate and hit debug, and a simulation of a Slate will appear.

    The new platform will have a great set of Could Services to make it easier to share images etc with friends over the cloud, apps working together. Apps are connected to each other and the cloud. Pull information from other apps. A tiny API can be used for this for developers. Microsoft will also give developers and customers access to Windows Store, it will make it much easier to buy and sell apps. This will probably also boost and increase development of apps for Windows 8. Within Visual Studio 11, developers can easily package apps and publish them to the Windows Store; they just use the Store menu in Visual Studio 11.

    Everyone at Build got a Developer Preview of Samsung’s iCore5 Slate with a Developer Preview of Windows 8, Expression Blend 5 and Visual Studio 11 Express. So now the fun can begin. You can download the bits by yourself at the Windows developer center: http://dev.windows.com. If you follow me on twitter (@fredrikn), you can read more about what will be presented during the conference. Tomorrow there will be a keynote, and then a lot of sessions, I will probably attend the HTML5 sessions and some other sessions like ASP.NET 4.5 and C# 5 etc.