Archive for November, 2011

ASP.NET 4.5 has introduced built-in support for bundling and minification of javascript and css resources.Here minification refers to the mechanism of compressing the javascript & stylesheet files thus reducing the size of data to transferred over the wire. The process of bundling involves combining multiple javascript/css files into one, thus reducing the number of HTTP calls made from the browser. The following post by Abhijit Jana gives a nice illustration of the feature covering the basics and  the advanced areas as well.

http://abhijitjana.net/2011/10/06/bundling-and-minification-in-asp-net-4-5/

Having read this, I was just thinking about these elements/classes under the System.Web.Optimization namespace are all stitched together to implement the bundling and minification functionality.There were some design level questions as well like is the bundled content cached once created at server side or the bundling is done for every request?.

(more…)

Advertisements

In the last post related to Roslyn we developed a very basic syntax walker. In this post we will see how we can use the same for code analysis and checking. As a good practice we generally try to avoid having instance members in a singleton class. This is true if you are making your business logic layer classes Singleton and would prefer to avoid mess up by multiple threads. In order to check that we need to check the following:

a) Whether the class has any instance fields or properties

b) Whether class is a singleton i.e having a private constructor

Let’s consider the following singleton class:

(more…)

The Roslyn project aims to expose the functionalities of C#/VB complier as API/Services. The Roslyn CTP was released this October.One of the important components of Roslyn is the Compiler API. This exposes an object model which provides access to information generated at the different stages of compilation.The first phase of any compilation process involves parsing and generating the syntax tree. In this post we will discuss about the basics of the Syntax Tree API.

(more…)