Wednesday, January 14, 2009

Window Application Vs Web Application using .NET

It is simple to get a choice between window and web application. Today web applications are the best way to support customers business process and their needs. Reason is simple web application are globally available and they are easy to access. Mostly they are independent of utilities, I mean there will be no such requirement that to run web application you have to install any third party software.

Simply we need to have any web browser and a reliable network, and we can start..
But still window/desktop application's developement is growing why?

* Fast data retrieval
* Bulk data updation
* Report generation
* Automation

Do we think only these are the basic reason to have window application instead of web.Let's go through some basic differences between them to get clear picture in our mind.

A window application looks and feels like a traditional Microsoft word application or excel.As like word and excel windows application require installation on client machines.Window application can be stand alone program or can be act as interfaces for distributed application.

It mean's the upside of a window application is the simplicity and the slickness of its interfaces but the downside is its troublesome installation and upgrades.

Where as web application runs on web servers and uses clients browsers for user interfaces,they are not expensive to install,upgrade, and maintain.

If a change needs to be made in web application it needs only be made at one location and i.e. on the server.

-
Be in touch as I think there are lots of reason to have growing demand of window vs Web application developement.

Monday, January 12, 2009

Let's decide C#.NET is better or VB.NET

Well, Its a general question which raises everytime in our mind whenever we have to make choice. Mostly it depends on the availability of resource and familiarity with the language. Because no one is willing to put their hands in such tolls or language which become very difficult to understand and manage as they are not familier with the tool.

Starting from C#,C#'s most salient advantage over VB.NET is its capability to contain embedded blocks of fast efficient C++ code. It means you could use pointers to access an array, for example .

But definetely there are certain situation when you have to decide either I should go for C# or VB.NET. I'm not trying to take side of any one,my motive is to only make your decision easy.

Sunday, January 11, 2009

Best uses of enumeration with switch case

Today in the world of Rapid Application Development .NET is a rich tool having large extent of flexibility, but while programming we need to take care of certain things so that our code can not loose this flexibility.

I have seen many skilled developers who are willing to use switch case but they usually like to use it in such a manner that in future it become useless, I mean if they require some modification then it will become a difficult task.

Whenever there is requirement of switch case we need to be sure of datatype involved and the range of value. If we get this picture in our mind than it will become easy to enhance switch case through enumeration. Lets understand it with an example:

I have a car object and I'm retrieving cars color from database which is integer value 0,1,2 . Now I need to show car's color.So I have created an enumeration with name CarColor.

enum CarColor
{
RED = 0,
BLACK = 1,
WHITE = 2
}

Now I will create a function which will decide the car color and return me the color of car.

private string ShowCarsColor(int dbcarcolcode)
{
switch (dbcarcolcode)
{
case CarColor.RED:
return cstr(CarColor.RED);
case CarColor.BLACK:
return cstr(CarColor.BLACK);
case CarColor.WHITE:
return cstr(CarColor.WHITE);
default:
return "Invalid Color";
}
}

Well ,I have to simply call it and I will get the desired result. Now you will ask what's new with it,So let me point out those things:

*Readability - Because I have already documented my code
*Few No. of lines of code- I have saved many lines of code
*Flexibility and scalability - If you want to add more colors in future ,Of course you can and I'm sure in a easy way.

So why should not we try it have a try.
-
If you are aware of best usages of switch case then feel free to post your valuable comments.

Blog List