Sunday, October 3, 2010

WebP on Google Code

Right now, I am looking at WebP, a new image format that is set as a competitor to JPEG format which is so widely on the web. We know JPEG is a lossy compression that tends to reproduce image as close as the original, and due to its ability to render closer to original images in less number of bytes, it is the widely used image (compression) format. According to Google, they tried to reproduce an image with WebP and found that the file size reduced by upto 40%, keeping the image quality same. Now, to replace JPEG by WebP is a Herculean task and...

Wednesday, September 8, 2010

Keyboard shortcuts poster

Just found that the team at Microsoft has published a printable list of keyboard shortcuts for Visual Studio 2010. I have downloaded my copy for C#, and it will be on my desk by the morning. Don't doubt, this is a must have no matter how much time you spend with Visual Studio IDE. You can download them here. Choose the file and format for your favorite language. If you are using Visual Studio 2008 and missed the poster, you can download the keyboard shortcuts poster for C# here and VB here. Don't miss ...

Tuesday, September 7, 2010

Null-coalescing operator in C#

This is the first time I seriously took an opportunity to look at null-coalescing operator in C#. Introduced in C# 2.0, this is one cool operator that I have hardly put into practice. Well, until now but not anymore. :) Null-coalescing operator is used to define a default value for nullable types as well as reference types. Let's look at an example. loginName = loginName ?? "guest"; What we are doing here is using the null-coalescing operator to check whether "loginName" is null. If it is null, the default value "guest" is assigned to it. This...

Sunday, June 20, 2010

Consuming Web Services

This is a continuation from the post on Web Services. To read the first part, click here. In the last post, I introduced Web Services to you. We created a service named ForexService that has one operation that accepts two input currencies as strings and returns the exchange rate as double. To consume the web service, let’s create a separate application (note that it can be any type of application, windows or web). This application will act as a...

Introducing Web Services

I talked about WCF in brief in one of my earlier postings, but that brought forward a need for a posting on the basics of web services. So, today I am going to talk about web services at a simpler level using a scenario about foreign exchange rates. I am not talking about forex process and it’s just for example’s sake…so don’t post back saying forex rates are not decided that way! ;-) The central bank in the country decides the forex rate for every...

Saturday, June 12, 2010

Microsoft is going the jQuery way

With jQuery gaining popularity day by day and Microsoft extending support towards it through its Visual Studio IDE, it looks like the future in ASP.NET is going to rely heavily on jQuery. Before I move forward with the integration part which is the actual topic of this blog, let me give you an idea on what jQuery is. If you don't know about jQuery yet or have not followed it recently, you must now. Use of jQuery is getting serious not only with .NET...

Friday, May 14, 2010

Patterns & Practices

In last two posts, I have been talking about the layered architecture in ASP.NET applications. If you missed them, you might want to read the first part and the second part, just to get a better insight on the topic I am discussing today.Dividing an application into multiple layers helps to: Keep different concerns of components separate so that there is clear distinction between different parts e.g. keeping presentation and business logic separate...

Wednesday, May 5, 2010

Introducing Business Objects

This is the second part of discussion on layered architecture in ASP.NET applications. I will extend the same examples, so you should read the first part here, or at least glance through the examples. Let us extend the data access layer class to include a method to update the database. ProductDataAccessLayer.cs using System; using System.Data; using System.Data.SqlClient; using System.Configuration; public class ProductDataAccessLayer { string...

Monday, May 3, 2010

Layered architecture for ASP.NET applications

This is the first post in a series of discussion on using layered architecture in ASP.NET applications. I will start with the basics and try to elaborate concepts gradually so as to help developers who have just begun to understand the concept of layers in an application. For quite a while, a tiered approach towards developing an application has been in the buzz. We hear people talking 2-tier, 3-tier, n-tier applications! What is a “tier” here?...

Sunday, April 25, 2010

Windows Communication Foundation

If you are familiar with web services, this should be easy. But let us start with the basics.We know about object oriented programming concept. In object oriented programming concept, we create an instance of a component in form of an object and work with it. As we see, objects are tightly coupled to the component and hence controls the component's lifetime.In contrary, service oriented applications are loosely coupled. In service oriented architecture, there exists a host (call it a server) that hosts a service and there exist clients to consume...

Tuesday, April 6, 2010

State management in ASP.NET

A web application runs over HTTP, a stateless communication mode. That means, each request for a page is a new request for the server, no matter if the same page is being requested again. When a page makes a round trip to the server (for example when you fill up a form and submit it), you can naturally expect the data you filled in to be lost when the page loads back...unless you somehow manage to save the data somewhere and fill them back in the controls when the page loads back. This is called "maintaining the state".In traditional environments...

Monday, April 5, 2010

ASP.NET Page Life Cycle

By understanding the details of how an ASP.NET page runs on the server before the rendered HTML is sent to the browser, one can realize how many significant stages a page goes through and how much control it releases to the developer. While the page runs through its life cycle, while the methods of the page’s base class can be overridden, a number of events are also raised that can be handled and exploited.I wanted to write in detail about the life cycle, but time constraints...you know. But, everything about the life cycle can be found here,...